VeloDB Cloud
SQL Manual
SQL Statements
DDL
Drop
DROP-CATALOG-RECYCLE-BIN

DROP-CATALOG-RECYCLE-BIN

Name

DROP CATALOG RECYCLE BIN

Description

This statement is used to delete db/table/partition in catalog recycle bin instantly.

You can get all meta informations that can be deleted by statement SHOW CATALOG RECYCLE BIN.

grammar:

  1. delete database by DbId
DROP CATALOG RECYCLE BIN WHERE 'DbId' = db_id;
  1. delete table by TableId
DROP CATALOG RECYCLE BIN WHERE 'TableId' = table_id;
  1. delete partition by PartitionId
DROP CATALOG RECYCLE BIN WHERE 'PartitionId' = partition_id;

illustrate:

  • When drop db/table/partition, the catalog recycle bin will delete them after catalog_trash_expire_second(in fe.conf) seconds. This statement will delete them to free disk usage timely.
  • 'DbId', 'TableId' and 'PartitionId' will be case-insensitive and not distinguish between ' and ''.
  • When drop a database which is not in catalog recycle bin, it will also delete all tables and partitions with same DbId in catalog recycle bin. Only if nothing is deleted,it will report an error. When drop a table which is not in catalog recycle bin, the treatment is similar.

Example

  1. Delete the database(include tables and partitions with same DbId) with id example_db_id
DROP CATALOG RECYCLE BIN WHERE 'DbId' = example_db_id;
  1. Delete the table(include partitions with same TableId) with id example_tbl_id
DROP CATALOG RECYCLE BIN WHERE 'TableId' = example_tbl_id;
  1. Delete the partition with id p1_id
DROP CATALOG RECYCLE BIN WHERE 'PartitionId' = p1_id;

Keywords

DROP, CATALOG, RECYCLE, BIN

Best Practice