How do I change sort keys and their order in a Redshift Destination table?

Last updated on Jun 12, 2023

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:

  1. Disable Auto Mapping for the specific table from the Schema Mapper.

    Disable the Auto Mapping option

  2. Click the Kebab menu icon next to the Destination Table name and click Drop Table.

    Click on Drop Table

  3. Click CREATE TABLE & MAP to create a new Destination table.

    Create a new table

  4. Select the Sort Key check box for all the fields you want to specify as sort keys.

  5. 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.

    Select the Sort Keys and change the order using arrow keys

  6. 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.


Revision History

Refer to the following table for the list of key updates made to this page:

Date Release Description of Change
Nov-07-2022 NA New document.

Tell us what went wrong