Managing the sort key
Data sorting in Amazon Redshift refers to how data is physically sorted on the disk. Data sorting is determined by the sort key defined on the table. Amazon Redshift automatically creates in-memory metadata, called zone maps. Zone maps contain the minimum and maximum values for each block. Zone maps automatically enable eliminating I/O by not scanning blocks that do not contain data for queries. Sort keys make zone maps more efficient.
A sort key can be defined on one or more columns. The columns defined in the sort keys are based on your query pattern. Most frequently, filtered columns are good candidates for the sort key. The order of sort key columns is defined from low to high cardinality. Sort keys enable range-restricted scans to prune blocks, eliminating I/O and hence optimizing query performance. Redshift Advisor provides recommendations on optimal sort keys and automatic table optimization handles the sortkey changes based on our query pattern.
...