Databases Reference
In-Depth Information
CREATE PARTITION FUNCTION PF_SQLROCKS AS RANGE LEFT FOR VALUES (1, 100, 1000)
This will create four partitions, as indicated in Table 15-1.
Table 15-1: Partition functions
Partition Number
Data Values
1
< =1
2
> 1and < = 100
3
> 100 and < = 1000
4
> 1000
Partition Schemes
The partition scheme defines the file groups that are used to hold the data for various partitions that
have been created in the table. If you can plan ahead, a good idea is to have more file groups available
to assign partitions later in case the table grows. However, you cannot assign a smaller number of file
groups than partitions.
CREATE PARTITION SCHEME PS_SQLROCKS
AS PARTITION PF_SQLROCKS
TO (DB_FG1, DB_FG2, DB_FG3, DB_FG4)
This will assign file groups to the partitions as indicated in Table 15-2.
Table 15-2: Partition schemes
Partition Number
Data Values
File Group
1
< =1
DB_FG1
2
> 1and < = 100
DB_FG2
3
> 100 and < = 1000
DB_FG3
4
> 1000
DB_FG4
Partition Tables or Indexes
Once the partition function and partition scheme have been created, you can create a partitioned table or
index.
Search WWH ::




Custom Search