Sie sind auf Seite 1von 1

Chapter 1: Creating 27

Data Type Definition


OLDBIT TINYINT
SMALLDATETIME TIMESTAMP
SMALLMONEY NUMERIC ( 10, 4 )
SYSNAME VARCHAR ( 30 ) NOT NULL
TEXT LONG VARCHAR
UNIQUEIDENTIFIER BINARY ( 16 )
UNIQUEIDENTIFIERSTR CHAR ( 36 )
XML LONG VARCHAR

1.12 Free Space


Currently there is only one CREATE TABLE element that classifies as a table
property: the PCTFREE free space percentage.
<table_element> ::= <column_definition>
| <table_property>
| <table_constraint>
<table_property> ::= PCTFREE <free_percent>
<free_percent> ::= integer literal in the range 0 to 100
By default SQL Anywhere will attempt to leave 100 bytes of free space in every
page when inserting new rows into a database using a page size of 1K, and 200
bytes if the page size is larger than that. Free space allows rows to grow in size
without being split into pieces stored on separate pages. Rows grow in size
when columns become longer, and the internal fragmentation caused by too
many row splits causes database I/O to slow down.
You can override the default free space amount by specifying a PCTFREE
percentage in the range 0 to 100. Zero means youre not worried about fragmen-
tation and its okay for the server to fill up each page when inserting data. Use
100 if you want to force the server to insert each new row in a separate page;
100% free space is an impossible goal, as one row per page is as close as the
servers going to get.
Large strings wont necessarily fill up a page, regardless of the free space
setting. Thats because the portion of a string past byte 254 is stored in one or
more separate extension pages; see Section 10.6.2, Table Fragmentation, for
more information about long columns and extension pages.
Also, when a new row is inserted it will not be split if it would fit entirely
on a single page, regardless of the free space setting.

1.13 Table Constraints


Table constraints can be used instead of column constraints to define the same
things. Table constraints are exactly like column constraints with one major
exception: A table constraint can apply to more than one column at the same
time.

Das könnte Ihnen auch gefallen