Tables without compression
Advertisement
RStoolKit Result: Tables without compression
Many of us already know the importance of the compression in RedShift. We need to reduce the size of the table and improve the query performance. But make sure you should not compress the sort key column or the first column of the sort key.
Find the tables without compression:
select
"schema",
"table"
FROM
pg_catalog.svv_table_info
WHERE
encoded <> 'Y'
AND "schema" not like 'pg_temp%'
How to fix the problem:
We can compress the exisiting columns or change the compression type in RedShift. You have to recreate the table with compression. By default if you didn’t mention anything during the table creation then RedShift will automatically pick the right compression algorithm.
- For exsiting tables, run the Amazon Redshift Column Encoding Utility to choose the right compression algorithm.
- For new tables, pick the right compression or let RedShift choose best compression.
External Link:
- RedShift Create table - Documentation
- RedShift column encoding
- Choosing a column compression type
- Redshift column encoding utility
Loading Comments