16.20 - RELEASE ROWS - Teradata Database - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-24
dita:mapPath
wkf1512081455740.ditamap
dita:ditavalPath
TD_DBS_16_20_Update1.ditaval

Removes the logically deleted rows from a load isolated (LDI) table or a join index. You use this option to reclaim the space occupied by the deleted rows. You should collect statistics when you perform this operation on an LDI table or a join index. Reclaiming space on a regular basis improves query performance on the LDI table or a join index. This operation physically deletes those rows that are marked as logically deleted. The corresponding secondary indexes are maintained.

You must have the DROP TABLE privilege to perform this operation.

An EXCLUSIVE lock is placed on the table to perform the deletion.

DELETED
Optionally, the DELETED keyword can be specified for readability.
AND RESET LOAD IDENTITY
The RowLoadID of the rows is set to 0. The version number of the table is incremented and the CurrLoadID value is set to 0.
If this option is not specified, the version number of the table is not changed.

Example: Remove Logically Deleted Rows

ALTER TABLE lditab1 RELEASE ROWS;

Example: Remove Logically Deleted Rows and Reset RowLoadID

ALTER TABLE lditabl2 RELEASE DELETED ROWS AND RESET LOAD IDENTITY;