How do I change sort keys and their order in a Redshift Destination table?
You cannot change the sort keys and their order in an existing Redshift Destination table. To change the sort keys, you must drop the Destination table and create a new one with the desired sort keys. However, by doing this, you lose your existing data in that Destination table. You can re-ingest the historical data into the new table by using the Restart Historical Load option for the Pipeline Object from the Pipeline Detailed View. The re-ingested historical data does not count towards your quota consumption and is not billed.
Perform the following steps to change the sort keys and their order:
-
Disable Auto Mapping for the specific table from the Schema Mapper.
-
Click the Kebab menu icon next to the Destination Table name and click Drop Table.
-
Click CREATE TABLE & MAP to create a new Destination table.
-
Select the Sort Key check box for all the fields you want to specify as sort keys.
-
Use the Up/Down arrow keys next to the field name to change its order of placement. For higher performance of the query, place the sort key fields together at the top in the Destination table.
-
Specify the Destination Table Name and click CREATE TABLE & MAP.
A new Destination table is created with the specified sort keys and order. The data is replicated into this table as per the Pipeline schedule.