Using EXPLAIN to Determine All Database Objects a View Accesses - Teradata Database

SQL Data Manipulation Language

Product
Teradata Database
Release Number
15.10
Language
English (United States)
Last Update
2018-10-06
dita:id
B035-1146
lifecycle
previous
Product Category
Teradata® Database

Using EXPLAIN to Determine All Database Objects a View Accesses

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 all the objects a particular view accesses, including any nested views, use the SHOW statement. See “SHOW” in SQL Data Definition Language.

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;