11/23/2022 15:09 | Category: databases

Tags: redshiftmaintenance

aws redshift dynamic sort keys

Previously when working on Redshift clusters tables needed to be recreated in order to change the sort key (how data is stored and analyzed by the query analyzer).

Now, as of 2019, we're able to work with tables to ALTER SORT KEY which will force Redshift to adjust the data layout in the background while ensuring the table is available for users to query.

This is great if you notice that the sort key you're using isn't actually doing much for the analyzer. While there are auto sort keys, if you're defining your own you can instead roll an ALTER SORT KEY to better refine your selection over time.