NUSI Bit Mapping and Query Covering | VantageCloud Lake - NUSI Bit Mapping - 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

NUSI bit mapping is a technique used by the Optimizer to effectively link multiple low-selectivity indexes to create a result that drastically reduces the number of base rows that must be accessed to retrieve the desired data. The process determines common rowIDs among multiple NUSI values by means of the logical intersection operation. The method is explained in more detail in the following sections.

Restrictions for When Bit Mapping Is Used

Vantage only performs NUSI bit mapping when low selectivity indexed conditions are ANDed but their composite selectivity is high. When WHERE conditions are connected by a logical OR, the Optimizer typically performs a full-table scan and applies the ORed conditions to every row without considering an index.

This is not always the case. If low selectivity conditions ORed conditions are ANDed with other low selectivity conditions, but the composite selectivity is high, the Optimizer may choose to use a composite NUSI or a single-column NUSI.

Computing NUSI Bit Maps

Use the following query to show how NUSI bit maps are computed.

SELECT *
FROM employee_table
WHERE salary_amount > 20000
AND   gender_code = 'M'
AND   full_time = 'FT';
The following process shows the method for computing NUSI bit maps. The actions described occur concurrently on all AMPs.
  1. The literals 20,000, M, and FT are used to access the corresponding rows from the index subtables.
  2. For n-1 indexes, each AMP creates separate bit maps of all 0 values.

    n-1 is 2 because there are three NUSIs defined, one for each condition in the WHERE clause.

  3. The AMPs equate each base table rowID in each qualifying NUSI row with a single bit in the map, and each such map bit is turned ON.
  4. The resulting bit maps are ANDed together to form the final bit map.
  5. Each base table rowID in the remaining NUSI is equated to a single bit in the final bit map, and the state of that map is checked.
Map Bit Result
OFF (0) No action is taken and the next map bit is checked.
ON (1) The rowID is used to access the table row and all remaining, or residual, conditions are applied to that row.

Determining If Bit Mapping Is Being Used

To determine whether bit mapping is being used for your NUSIs, use the EXPLAIN request modifier and examine the reports for your queries.

See EXPLAIN Request Modifier and EXPLAIN Request Modifier.