Amazon Redshift
Database Developer Guide (API Version 2012-12-01)


Use the SVV_INTERLEAVED_COLUMNS view to help determine whether a table that uses interleaved sort keys should be reindexed using VACUUM REINDEX. For more information about how to determine how often to run VACUUM and when to run a VACUUM REINDEX, see Managing Vacuum Times.

SVV_INTERLEAVED_COLUMNS is visible only to superusers. For more information, see Visibility of Data in System Tables and Views.

Table Columns

Column Name Data Type Description
tbl integer Table ID.
col integer Zero-based index for the column.
interleaved_skew numeric(19,2) Ratio that indicates of the amount of skew present in the interleaved sort key columns for a table. A value of 1.00 indicates no skew, and larger values indicate more skew. Tables with a large skew should be reindexed with the VACUUM REINDEX command.
last_reindex timestamp Time when the last VACUUM REINDEX was run for the specified table. This value is NULL if a table has never been reindexed using VACUUM REINDEX.

Sample Queries

To identify tables that might need to be reindexed, execute the following query.

select tbl as tbl_id, as table_name, col, interleaved_skew, last_reindex from svv_interleaved_columns, stv_tbl_perm where svv_interleaved_columns.tbl = and interleaved_skew is not null; tbl_id | table_name | col | interleaved_skew | last_reindex --------+------------+-----+------------------+-------------------- 100068 | lineorder | 0 | 3.65 | 2015-04-22 22:05:45 100068 | lineorder | 1 | 2.65 | 2015-04-22 22:05:45 100072 | customer | 0 | 1.65 | 2015-04-22 22:05:45 100072 | lineorder | 1 | 1.00 | 2015-04-22 22:05:45 (4 rows)