Databases Reference
In-Depth Information
RANGE_HI_KEY RANGE_ROWS EQ_ROWS DISTINCT_RANGE_ROWS AVG_RANGE_ROWS
------------ ---------- ------- ------------------- --------------
826 0 305 0 1
831 110 198 3 36.66667
832 0 256 0 1
Listing 3-12.
RANGE_HI_KEY is the upper boundary of a histogram step; the value 826 is the upper
boundary for the first step displayed, and 831 is the upper boundary for the second step
shown. This means that the second step may contain only values from 827 to 831.
With that in mind, and to better understand the rest of the histogram structure and
how the histogram information was aggregated, run the following query to obtain
the real number of records for ProductID s 827 to 831, and we'll compare them against
the histogram.
SELECT ProductID , COUNT (*) AS Total
FROM Sales . SalesOrderDetail
WHERE ProductID BETWEEN 827 AND 831
GROUP BY ProductID
Listing 3-13.
This produces the following result:
ProductID Total
--------- -----------
827 31
828 46
830 33
831 198
Listing 3-14.
Search WWH ::




Custom Search