RECOMPRESS
Purpose
Use this statement to improve the compression of tables.
Prerequisites
- You must either have the system privilege
USE ANY SCHEMAor the object privilegeUSAGEon the target schema, or the schema must be owned by you or one of your assigned roles. - You must either have one of the modifying
ANY_TABLEsystem privileges or any of the modifying object privileges (ALTER,INSERT,UPDATE,DELETE) on all affected tables, or the tables must be owned by you or one of your assigned roles. RECOMPRESS DATABASErequires that you have privileges to modify all tables in the database.
Syntax
recompress::=
Usage notes
-
This command implies a
COMMITbefore and after recompressing any of the specified tables, except if you use the single table alternativeRECOMPRESS TABLE. - The execution time of this command can take some time. Exasol will try to only recompress those columns
where a significant improvement can be achieved, but you can enforce the recompression using the
ENFORCEoption. - Recompression of a table makes sense after you have inserted a big amount of new data on top of an existing large amount of data. After that, the compression ratios do not need to be significantly better than before.
- You can partially compress a table by specifying columns.
- The compressed and raw data size of a table is available in the system table EXA_DBA_OBJECT_SIZES.
Examples
RECOMPRESS TABLE t1 (column_1);
RECOMPRESS TABLES t2,t3 ENFORCE;