Skip to main content

Datometry Documentation

Enable or Disable Index Statistics Collection Error Messages

On databases that do not support statistics, you can specify if Hyper-Q should return an error when attempting to collect or drop statistics, or ignore the error.

If enabled, Hyper-Q reports errors if it fails to either collect or drop statistics. In the following example a COLLECT STATISTICS statement and a DROP STATISTICS statement return the following errors when allow_stats_commands is set to true.

COLLECT STATISTICS COLUMN column_name ON table_name;

*** Failure 3706 DTM9074: Unsupported Collect Statistics 

DROP STATISTICS COLUMN column_name ON table_name;

*** Failure 3706 DTM9223: Unsupported Drop Statistics  

You can configure Hyper-Q to ignore these errors and not report them.

The syntax for allow_stats_commands is:

allow_stats_commands = true | false

where:

Parameter

Description

true

Hyper-Q reports errors when it encounters a database that does not support statistics collection.

false

Hyper-Q ignores errors when either a COLLECT STATISTICS statement or a DROP STATISTICS statement is issued against a database that does not support statistics collection.

Hint Scope

The allow_stats_commands hint can be specified at the statement, request, session, and application level. To learn more about Hyper-Q SQL hints, and how to use them within a SQL query, see About Hyper-Q SQL Hints.

Example 38. Specify that Hyper-Q use allow_stats_commands as a Global Setting

You can specify allow_stats_commands as an application level (or global) setting in the Hyper-Q configuration file (dtm.ini). To enable allow_stats_commands, set it to true. The default value is false.

"gateway".allow_stats_commands=true

If set to true, Hyper-Q reports errors if it fails to collect or drop statistics. In the following example a COLLECT STATISTICS statement and a DROP STATISTICS statement return the following errors when allow_stats_commands is set to true.

COLLECT STATISTICS COLUMN column_name ON table_name;

*** Failure 3706 DTM9074: Unsupported Collect Statistics 

DROP STATISTICS COLUMN column_name ON table_name;

*** Failure 3706 DTM9223: Unsupported Drop Statistics  

To learn more about specifying a hint as a gateway option in the Hyper-Q configuration file, see Gateway Configuration Parameters.



Example 39. Specify that Hyper-Q use allow_stats_commands as a Query Hint

You can specify allow_stats_commands as a query hint. This example specifies the hint within COLLECT STATISTICS and DROP STATISTICS statements, and disables error reporting for databases that do not support statistics collection.

COLLECT 
--@dtm_stats_commands=false
STATISTICS COLUMN column_name ON table_name;

DROP 
--@dtm_allow_stats_commands=false
STATISTICS COLUMN column_name ON table_name;

To learn more about Hyper-Q SQL hints, and how to use them within a SQL query, see About Hyper-Q SQL Hints.