A clustering key is a subset of columns in a table (or expressions on a table) that are explicitly designated to co-locate the data in the table in the same micro-partitions. This is useful for very large tables where the ordering was not ideal (when the data was inserted/loaded), or extensive DML has caused the table’s natural clustering to degrade.
Create a Clustering Key
You can only create one clustering Key per table.
-
Click on a table to access the properties on the right panel
-
Open Clusters & Keys tab
-
Click the "CK" button on the bottom bar to create a clustering key
-
Expand the Members menu and specify the clustering key using columns (a) or expressions (b).
-
Select the "Columns" radio button and tick the columns, which will form part of the clustering key in order of first to last.
-
To use a custom expression, select the "Expression" radio button and manually specify the comma-separated clustering key.
-
Properties:
You may:
• Set clustering key name
• Select member columns in a specific order
• Edit the clustering expression manually
• Add or edit the CK description/comment