Using EXPLAIN to Determine the Database Objects that a View Accesses - Advanced SQL Engine - Teradata Database

SQL Data Manipulation Language

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
qtb1554762060450.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata Vantage™

Explaining a request does not necessarily report the names of all the underlying database objects accessed by that request, but it does provide the names of all the base tables accessed.

To determine the objects that a particular view accesses, including any nested views, use the SHOW statement. See “SHOW” in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144.

For example, the following request reports the create text and containing databases for all underlying tables and views accessed by view_name.

     SHOW QUALIFIED SELECT *
     FROM view_name;

On the other hand, the following request reports only the underlying tables accessed by view_name, and not any nested views that are accessed.

     EXPLAIN SELECT *
     FROM view_name;