Chapter 10: Hash-Based Update Statistics

Adaptive Server versions 15.7 ESD #2 and let you gather hash-based statistics on minor index attributes and unindexed columns instead of using sort-based statistics. Using hash-based instead of sort-based statistics improves performance by reducing the number of required scans, and by avoiding disk-based sorting.

Hash-based statistics allow greater flexibility than sort-based statistics:

Hash-based statistics use a low-domain algorithm for columns with fewer than 65536 unique column values, and a high-domain algorithm for columns with 65536 or more unique column values. Of the two algorithms, low-domain hashing produces the more accurate histogram because Adaptive Server uses the actual counts of all the domains values to create the histogram. High-domain hashing may produce a less accurate histogram because Adaptive Server produces an in-memory intermediate histogram that it updates for each block of 65536 unique values.

Because gathering hash-based statistics is CPU-intensive, you may want to create an execution class with EC3 attributes to which you can assign the update statistics login. Adaptive Server gives lower priority to update statistics maintenance sessions, reducing the impact when the maintenance window is small or nonexistent.

When running update statistics, Sybase recommends that you: