Comparing ALTER TABLE TO CURRENT and ALTER TABLE … REVALIDATE - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

During ALTER TABLE TO CURRENT processing, if the starting expression with the newly resolved DATE, CURRENT_DATE, or CURRENT_TIMESTAMP value does not fall on a partition boundary, Vantage must scan all rows before repartitioning the rows based on the new partitioning expression. Column partitioned tables must be empty before using ALTER TABLE TO CURRENT.

For an ALTER TABLE TO CURRENT operation where an all-row scan is unnecessary, the table can contain data.

The following table compares ALTER TABLE TO CURRENT and ALTER TABLE … REVALIDATE. See General Rules and Restrictions for the REVALIDATE Option.

ALTER TABLE TO CURRENT ALTER TABLE ... REVALIDATE
Periodically modify the partitioning.
  • Updates partitioning information in the table header after an upgrade to a major release.
  • Corrects any improperly partitioned rows after restoring to a system architecture that is different from the one from which an archive was made.
  • Corrects improperly partitioned rows caused by a system problem.
Resolves the DATE, CURRENT_DATE, and CURRENT_TIMESTAMP to their current values. Uses the most recently resolved DATE, CURRENT_DATE, and CURRENT_TIMESTAMP values.
Updates the partitioning information in the table header. Updates the partitioning information in the table header.
When reconciling the rows of the specified table or join index, Vantage skips a partition if all reconciliation affects none of its rows.

This assumes that the rows of the table or join index are properly partitioned before submitting the ALTER TABLE TO CURRENT request.

When reconciling the rows of the specified table, Vantage scans all its partitions if you specify a null partition handler.

You cannot specify this option for join indexes.

Reconciles all rows of specified table or join index.

If request specifies null partition handler, Vantage deletes irreconcilable rows.

If the request specifies a WITH INSERT INTO save_table null partition handler, Vantage saves irreconcilable rows to a save table before deleting them.

You cannot specify WITH INSERT INTO save_table for join indexes because rows from a join index cannot be deleted using ALTER TABLE TO CURRENT.

If request does not specify null partition handler, Vantage ends request if existing row cannot be reconciled.

Reconciles only rows of specified table or join index if request specifies null partition handler.

If the request specifies a WITH INSERT INTO save_table null partition handler, Vantage saves irreconcilable rows to a save table before deleting them.

You cannot specify WITH INSERT INTO save_table for join indexes because rows from a join index cannot be deleted using ALTER TABLE TO CURRENT.