SYS_VACUUM_HISTORY - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

SYS_VACUUM_HISTORY

Use SYS_VACUUM_HISTORY to view details of vacuum queries. For information on the VACUUM command, see VACUUM.

SYS_VACUUM_HISTORY is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of data in system tables and views.

Table columns

Column name Data type Description
user_id integer The ID of the user who initiated the query.
transaction_id long The transaction ID for the VACUUM statement.
query_id long The query identifier for the VACUUM statement. You can join this table to the SYS_QUERY_DETAIL view to see the individual SQL statements that are run for a given VACUUM transaction. If you vacuum the whole database, each table is vacuumed in a separate transaction. For automated VACUUM operations, this value is null.
database_name text The name of the database.
schema_name text The name of the schema.
table_name text The name of the table.
table_id integer The ID of the table.
vacuum_type character The type of the VACUUM operation. Possible values are as follows:
  • Delete

  • Sort

  • Reindex

  • Recluster

  • Full

For more information on vacuum types, see VACUUM.

is_automatic boolean true if the operation is an automatic vacuum. Otherwise, false.
status character Description of the current activity being done as part of the vacuum operation:
  • Initialize

  • Sort

  • Merge

  • Delete

  • Select

  • Failed

  • Complete

  • Skipped

  • Building INTERLEAVED SORTKEY order

start_time timestamp The time the vacuum operation started.
end_time timestamp The time the vacuum operation ended. If the operation is ongoing, this field is blank.
record_time timestamp The time the vacuum operation was recorded in SYS_VACUUM_HISTORY.
duration integer The number of microseconds between the start and end of the vacuum operation. If the vacuum operation is ongoing, this field is blank.
rows_before_vacuum bigint The actual number of rows in the table plus any deleted rows that are still stored on disk (waiting to be vacuumed).
size_before_vacuum integer The size of the table before the vacuum operation began, in MB.
reclaimable_rows bigint The number of rows the vacuum operation estimates it will reclaim before starting.
reclaimed_rows bigint The number of rows the vacuum operation reclaimed.
reclaimed_blocks bigint The number of blocks the vacuum operation reclaimed.
sortedrows_before_vacuum integer The number of sorted rows in the table before the vacuum operation started.
sortedrows_after_vacuum integer The additional number of sorted rows in the table after the vacuum operation finished. This doesn't include the rows counted in sortedrows_before_vacuum.