15.10 - Resolver - Teradata Database

Teradata Database SQL Request and Transaction Processing

Teradata Database
Programming Reference
User Guide

The Resolver annotates the SynTree with information about such things as data conversions, column names, discretionary access control security checks, and underlying relationships, and then produces a more fleshed out parse tree called a ResTree, also called a Red Tree, which it passes to Security, Parameterized Value Peek, and then to Query Rewrite. The Resolver does not transform the request text in any way.

The following graphic shows a block diagram of Resolver activity.

1 The Resolver takes the SynTree as its input from the Syntaxer.

2 Each database or user, table, view, trigger, stored procedure, and macro is assigned a globally unique numeric ID.

Each column and each index is assigned a numeric ID that is unique within its table.

These IDs are maintained in the Data Dictionary.

3 The Resolver refers to the Data Dictionary to verify all names and privileges and to convert those names to their equivalent numeric IDs.

4 The Resolver takes available information from the Data Dictionary cache, which is used on a least‑recently-used or most‑recently-used basis.

If the needed information is not cached, it is retrieved from the appropriate system tables.

Note that the Resolver spools all views unconditionally.

5 If a Request parcel contains views or macros, the Resolver retrieves the view or macro text from the Data Dictionary, resolves it, and then merges the elements of the resulting tree into the request tree.

6 The Resolver produces the ResTree as its output and passes it first to Security and then to Parameterized Value Peek.

At this point, the system peeks at any parameterized values or DATE, CURRENT_DATE, TEMPORAL_DATE, CURRENT_TIMESTAMP, or USER built‑in function values that can be evaluated for specific optimization opportunities. In some cases, the value of the TEMPORAL_TIMESTAMP function might also be peeked. See “Peeking at Parameterized Values in the Data Parcel” on page 28 for details.

Some additional SQL Flagger compliance checking is performed by the Resolver. The most significant of these compliance checks is a semantic check that detects instances in which data types are compared or converted and assigned implicitly. See SQL Fundamentals for information about the SQL Flagger.