The join index is partitioned by one or more partitioning levels. You can define either a single-level or multilevel partitioning for a join index, but only if the index is not row-compressed.
You cannot specify a PARTITION BY clause in the same join index definition as an ORDER BY CLAUSE.
You cannot collect statistics on the system-derived PARTITION#Ln columns for a join index.
- partitioning expression
- Defines partitions for the level. You can also specify the ADD keyword for a partitioning level. For more information about partitioning tables and join indexes, see Database Design, B035-1094. If the preceding item in the index list is a partitioning clause that is not part of an index clause, you must specify a COMMA character following the PARTITION BY clause. Otherwise, the comma is optional. You can define multilevel partitioning for an uncompressed join index, with as many as 62 partitioning levels. Each level must be defined by a RANGE_N or CASE_N function or by the COLUMN keyword. You cannot specify character partitioning expressions for columns or constants that use the Kanji1 or KanjiSJIS server character sets. The result of a partitioning expression that is not a RANGE_N or CASE_N function is cast to an INTEGER, if it is not already an INTEGER. The value must be from 1 through 65,535. A RANGE_N or CASE_N function is only allowed for single-level partitioning. The maximum number of partitioning levels that you can specify for a join index with 2-byte partitioning is 15. The maximum number of partitioning levels that you can specify for a join index with 8-byte partitioning is 62. A partitioning expression for a join index must be a deterministic expression and cannot specify external or SQL UDFs or columns having any of the following data types:
- ARRAY
- VARRAY
- BLOB
- CLOB
- Geospatial
- COLUMN
- Keyword to indicate partitioning level.
- AUTO COMPRESS
- NO AUTO COMPRESS
- To enable or disable autocompression:
- If you specify NO AUTO COMPRESS for a column partitioning level in a PARTITION BY clause, the system does not apply autocompression for a column partition unless you explicitly specify AUTO COMPRESS.
- If you specify AUTO COMPRESS for a column partitioning level in a PARTITION BY clause, the system applies autocompression for a column partition unless the you explicitly specify NO AUTO COMPRESS.
- If you specify neither AUTO COMPRESS nor NO AUTO COMPRESS for a column partitioning level in a PARTITION BY clause, the system applies the default autocompression determined by the AutoCompressDefault cost profile constant. For more information about AutoCompressDefault, see SQL Request and Transaction Processing, B035-1142.
- ALL BUT (column_name_list)
- ALL BUT (column_group_list)
- A multicolumn partition with autocompression and system-determined COLUMN or ROW format that includes all of the columns in the join index definition that are not specified in column_name_list or column_group_list.
- COLUMN
- Specifies that the join index has a column-partitioned level.
- ROW
- Specifies that a column partition has ROW format. A ROW format means that only one column-partition value is stored in a physical row as a subrow.
- ADD constant
- The maximum number of partitions for a partitioning level is the number of partitions it defines plus the value of the BIGINT constant value specified by constant.