Amazon Redshift Connector Best Practices

Amazon Redshift Connector Best Practices

Sort Keys

Sort Keys

In an Amazon Redshift table, you can specify one or more columns as a sort key to sort data in a table.
Amazon Redshift stores columnar data in 1 MB disk blocks. The minimum and maximum values for each block is stored as part of the metadata. Sorting the data enables you to execute the queries faster with predicates, such as filters and joins that reference the sort key.
You can have only one sort key per table.
If the sort key is derived from a source table column, you can read the source data in the sorted order and then upload the data in the sorted form to Amazon Redshift. This process saves the sorting time in an Amazon Redshift table. However, sorting the data before loading helps only if the sort key is the same table as source table column. Otherwise, you do not have to sort the data before you load the data to Amazon Redshift.

0 COMMENTS

We’d like to hear from you!