USTLOW_SAMPLE environment option
Use the USTLOW_SAMPLE session environment option to enable or disable sampling during the collection of index statistics for UPDATE STATISTICS LOW operations in the current session.
By default, when the UPDATE STATISTICS statement gathers distribution statistics for a table on which one or more indexes are defined, the database server reads all index leaf pages in sequence to calculate index statistics, such as the number of leaf pages, the number of unique lead index-key values, and cluster information.
For an index with more than 100 KiB leaf pages, estimating these index statistics from sampling can increase the speed of the UPDATE STATISTIC LOW operation.
To set the USTLOW_SAMPLE session environment variable, specify:
'0'
orOFF
to disable sampling'1'
orON
to enable sampling
The value that you specify overrides the setting of the USTLOW_SAMPLE configuration parameter for the session.
SET ENVIRONMENT USTLOW_SAMPLE '1';
SET ENVIRONMENT USTLOW_SAMPLE ON;