Cost of Join Index Maintenance - Teradata VantageCloud Lake

Lake - Database Reference

Deployment
VantageCloud
Edition
Lake
Product
Teradata VantageCloud Lake
Release Number
Published
February 2025
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
ohi1683672393549.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
ohi1683672393549

The largest resource burden for any join index is incurred by its maintenance: inserting, updating, and deleting rows in the join index table. Similar to creation costs, types of join indexes incur different maintenance costs.

Join indexes can be expensive to maintain. The most important factor in the decision to use a join index is likely to its maintenance cost.

Each time a join-indexed base table column is updated, the corresponding join index table column must also be updated. Each time a new row is added to or an existing row is deleted from a join-indexed base table, the corresponding join index table rows must also be inserted or deleted. Therefore, evaluate the benefit of a join index created to enhance your standard queries vis-a-vis its cost to create and maintain (see Cost/Benefit Analysis for Join Indexes).

Maintenance Cost Optimizations Based on Foreign Key-Primary Key Joins

Consider the added cost of join index maintenance carefully when you are designing the indexes for your data warehouse to make sure that the minimum number of join indexes can be called on by the Optimizer to cover the maximum number of queries. Designing with foreign key-primary key joins allows you to make these optimizations.

Whenever a base table column set that is shared with a join index is updated or deleted, or when a new row is inserted into the base table, the system generates extra steps to maintain the base table and join index concurrently. If the base table is specified as part of an outer join in the join index definition, the steps can be more complex because maintenance may be needed for both matched and unmatched row sets.

However, when the join columns have a foreign key-primary key relationship, the system treats inner and outer joins alike (see Restriction on Coverage by Join Indexes When a Join Index Definition References More Tables than a Query).

Maintenance Cost Optimizations for DELETE ALL Operations

A fastpath optimization is one that can be performed faster if certain conditions are met. For example, in some circumstances DELETE and INSERT operations can be performed faster if they can avoid reading the data blocks and avoid transient journaling.

Vantage uses both fastpath and deferred fastpath row partition DELETE operations for the following cases:
  • Deferred row partition deletion on a row-partitioned base table when a join index defined on the base table is not row-partitioned
  • Deferred partition deletion on a row-partitioned join index that is defined on a table
  • Deferred partition deletion on both a row-partitioned join index and its row-partitioned base table

    Vantage performs the fastpath row partition deletion operations on the join index and the base table independently.

Vantage can perform fastpath DELETE ALL operations, but not deferred row partition deletion operations, for the following cases:
  • If the deleted table has a a conditional DELETE with predicates and covers the entire join index, the join index is eligible for a fast path DELETE.
  • All single-table join indexes.
  • A multitable join index when the join between the tables is either an inner join or the table being deleted is the outer table in the join.
  • An implicit transaction with a single-statement DELETE ALL table_name when the table has a join index defined on it.
  • An implicit transaction with a multiple-statement request.
  • An ANSI/ISO session mode transaction with a multiple-statement request.
  • A Teradata session mode transaction with a multiple-statement request.