Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Within this workshop you will:
Create a scenario in the sample database which unevenly distributes values for a column.
Examine the execution plans of two queries under various circumstances and notice how an ideal execution plan for both queries is never achieved under such a situation without histograms.
Create histograms for the table. Then examine the execution plans for the same two queries again and notice how the Optimizer is able to choose the optimal plan for each query due to the presence of the histogram.
Consider a scenario where the selectivity calculations of the Optimizer are incorrect and how gathering extended statistics solves this problem.
Begin this exercise by reinitializing the sample COMPANY database using the scripts provided to you for this purpose.