RECOMPRESS

Purpose

Use this statement to improve the compression of tables.

Prerequisites

  • You must either have the system privilege USE ANY SCHEMA or the object privilege USAGE on 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_TABLE system 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 DATABASE requires that you have privileges to modify all tables in the database.

Syntax

recompress::=

Recompress Statement

Usage notes

  • This command implies a COMMIT before and after recompressing any of the specified tables, except if you use the single table alternative RECOMPRESS 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 ENFORCE option.
  • 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

Copy
RECOMPRESS TABLE t1 (column_1);
Copy
RECOMPRESS TABLES t2,t3 ENFORCE;