Minimum Number of Rows

The compressed columns/column groups are stored in TimesTen as separate tables, one per column group. There is some storage overhead associated with each table, so it is not beneficial to compress tables that contain only a small number of rows.

You can specify a minimum row count below which a table will not be considered for compression. Use the minrows field of the -compression command-line option. This field takes a (64-bit) integer value; any table with less than this number of rows is not considered for compression. The minimum value is 1 (always consider compression) and the default is 1024. There is no need to change this value.

When evaluating Oracle database columns and tables for compression, the algorithm used is as follows:
  • Compression is evaluated only if a compression level greater than 0 is specified.
  • For each table being imported:
    • If the table's row count is less than minrows, no further evaluation is performed, and the table is not compressed in the TimesTen database.
    • If the table qualifies based on its row count, it is scanned, and column-level metrics (the total number of non-NULL values and the total number of distinct values) are collected.
    • For each column in the table:
      • If padding > 0 is specified, the number of distinct values is increased by padding %.
      • If compression level 2 is used, the pointer size (1, 2, or 4 bytes) is determined based on the number of distinct values. Otherwise, the pointer size is set to 4 bytes (compression level is 1).
      • The total size of the data for this column (across all rows) in the TimesTen database is estimated in both its uncompressed and compressed forms. If the ratio of compressed size to uncompressed size is less than or equal to the target minimum compression factor, the column is marked as a candidate for compression.
    • A detailed sizing calculation is performed at the table level to estimate the total size of both the uncompressed table and the compressed table (where all candidate columns are compressed) in the TimesTen database. This calculation accounts for the various internal storage structures and overheads, rather than just the raw data. If the ratio of the projected compressed size to the projected uncompressed size is less than or equal to the target minimum compression factor, the table is marked for compression.

When the CREATE TABLE DDL statements are generated in the CreateTables.sql file, the appropriate compression clauses are included for each table marked for compression. All columns marked for compression are compressed.

The space savings achieved through compression are greater than those achieved through type mapping. Using both options together provides the maximum space savings.