©2019 by Raghavendra Kambhampati

AWS Redshift – Analyzing & Vacuuming Tables

Updated: Aug 16, 2019

Analyzing & Vacuuming Tables

Vacuum –Deep Copy


• Is an alternate to VACUUM.

• Will remove deleted rows and also re-sort the table

• Is more efficient than VACUUM

• You can’t make concurrent updates to the table

• Deep copy options:

– Use original table DDL and run INSERT INTO…SELECT • Best option -Retains all table attributes

– Use CREATE TABLE AS

• New table does not inherit encoding, distkey, sortkey, primary keys, or foreign keys.

– Use CREATE TABLE LIKE

• New table inherits all attributes except primary and foreign keys – Use a TEMP table to COPY data out and back in again