USER MANUALS

COMPACT_CACHE

Description

This procedure launches the task for cache compaction. This task can only be executed on databases that use a data source for cache that only supports cache full, such as Impala, PrestoDB, Trino (formerly know as PrestoSQL), Spark or Hive. For environments using the Denodo Lakehouse Accelerator, use the procedures described in the section Cache Maintenance for the Denodo Lakehouse Accelerator instead.

Important

This task is performed on the whole cache data source and is not restricted to the database used as input parameter. This means that if the data source is used for global cache or is shared with other databases for cache, all of them will be affected by the procedure.

During its execution it performs two operations:

  • Removes all outdated rows from control tables.

  • Deletes all storage tables that back expired temporary tables in the VDP Server.

Given the nature of these operations, the invoker must ensure that the VDP Server is not performing any other task involving the affected cache data source. The procedure provides an input parameter that sets to enter single user mode, which will automatically queue any other concurrent requests.

Syntax

COMPACT_CACHE(
    database_name : text,
        enter_single_user_mode : boolean
)
  • database_name: name of the database. This is the database whose cache data source will be compacted. Note that compaction affects the data source itself, so every database using this data source for cache will be affected.

  • enter_single_user_mode: When true, the procedure will enter single user mode. This will avoid accidental corruption on cache control tables that could happen is some query accessed the cache during the process.

This procedure does not return any value.

Privileges Required

Only global administrators or local administrators of the input database can invoke this procedure.

Add feedback