EXPLAIN VIRTUAL

Purpose

Use this statement to analyze what an adapter script is pushing down to the underlying data source of a virtual object.

Prerequisite

Privileges similar to the executed query.

Syntax

explain_virtual::=

Explain Virtual Statement

Usage Notes

  • If you access virtual objects in a query and use the EXPLAIN command, the actual query is not executed and no underlying data is transferred. The query is only compiled and optimized for pushing down as much logic as possible into the query for the underlying system. The result of that statement is a table containing the effective queries for the external systems.
  • You can use the EXPLAIN command as a subselect and then process its result through SQL.
  • Similar information about the details of a pushdown is available in profiling information, However, this way, it is easy to access.

Example

SELECT pushdown_id, pushdown_involved_tables, pushdown_sql FROM
(EXPLAIN VIRTUAL SELECT * FROM vs_impala.sample_07 WHERE total_emp>10000);

Example Result

PUSHDOWN_ID PUSHDOWN_INV PUSHDOWN_SQL
1 SAMPLE_07 IMPORT FROM JDBC AT 'jdbc:impala:<shortened>' STATEMENT 'SELECT * FROM `default`.`SAMPLE_07` WHERE 10000 < `TOTAL_EMP`'