qua_analyze_table#
Procedure orders the underlying system to update its object-level, or column-level statistics, or both. It uses the configuration to derive information about which statistics to calculate.
Depending on the underlying system, procedure issues a system-specific command requiring it to physically process the data to gather information useful for query optimization.
For example, if a Querona view View1(col1, col2) resides in a virtual database backed by Apache Spark,
its physical name in Spark is view1, then the procedure issues a Spark-specific command ANALYZE TABLE view1 FOR COLUMNS col1, col2
upon execution.
Note
If a view is materialized using multiple physical objects, like in “rotated tables” caching strategy, only the active physical object is analyzed.
Syntax#
qua_analyze_table @virtualName = 'virtualName'
[ , [@forceAllColumns] = forceAllColumns ]
[;]
Arguments#
@virtualName = ‘virtualName’
Name of the virtual object to analyze. virtualName is of type Sysname.
[@forceAllColumns] = forceAllColumns
Binary flag that instructs the procedure to override the statistics-oriented settings derived from metadata, and forces it to analyze data for all physical columns. forceAllColumns is of type Boolean with a default of NULL.
Example#
Updates objects statistics for DimDate view cached on Apache Spark. Configuration derives from object-level metadata stored in Querona.
EXEC qua_analyze_table @virtualName = 'DimDate';
Updates objects statistics for DimDate view cached on Apache Spark. Configuration derived from object-level metadata is ignored and analysis target all physical columns.
EXEC qua_analyze_table @virtualName = 'DimDate', 1