Link to home
Start Free TrialLog in
Avatar of motioneye
motioneyeFlag for Singapore

asked on

sp_updatestats and sp_helpstats what is this use for

Hi,
I'm curious what is the statistic use in sql server? how it can improve the performance of sql server? I did heard also about the sampling ,so when will these function and furthermore how the statistic can be use in conjunctions with indexes?
ASKER CERTIFIED SOLUTION
Avatar of Sirees
Sirees

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of motioneye

ASKER

Hi,
Ok I had run the dbcc show_statistics, but not too sure how could the values down here meaningful to me or how will the results help me to boot the sql performance.


Statistics for INDEX 'IX_BOLA_ENTS'.
Updated              Rows                 Rows Sampled         Steps  Density                  Average key length      
-------------------- -------------------- -------------------- ------ ------------------------ ------------------------
Mar 27 2007  8:15PM  178888               19498                189    5.6552242E-5             34.89373

(1 row(s) affected)

All density              Average Length           Columns                                                                                                                                                                                                                                                          
------------------------ ------------------------ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5.59009E-6               4.0                      Cap_ent_ID
5.59009E-6               30.893732                Cap_ent_ID, DPS_Num
5.59009E-6               34.89373                 Cap_ent_ID, DPS_Num, Capture_ID

(3 row(s) affected)

RANGE_HI_KEY RANGE_ROWS               EQ_ROWS                  DISTINCT_RANGE_ROWS  AVG_RANGE_ROWS          
------------ ------------------------ ------------------------ -------------------- ------------------------
41           0.0                      1.0                      0                    0.0
945          159.2621                 1.0                      158                  1.0039916
2198         122.26211                1.0                      121                  1.0039916
4330         137.2621                 1.0                      136                  1.0039916
5008         73.262108                1.0                      72                   1.0039916
5773         73.262108                1.0                      72                   1.0039916
7222         233.2621                 1.0                      232                  1.0039916
7477         73.262108                1.0                      72                   1.0039916
8240         137.2621                 1.0                      136                  1.0039916
9272         137.2621                 1.0                      136                  1.0039916
9890         105.26211                1.0                      104                  1.0039916
10351        73.262108                1.0                      72                   1.0039916
10934        73.262108                1.0                      72                   1.0039916
12009        73.262108                1.0                      72                   1.0039916
13049        105.26211                1.0                      104                  1.0039916
14049        137.2621                 1.0                      136                  1.0039916
15464        105.26211                1.0                      104                  1.0039916
16504        73.262108                1.0                      72                   1.0039916
18734        105.26211                1.0                      104                  1.0039916
19706        137.2621                 1.0                      136                  1.0039916
20048        73.262108                1.0                      72                   1.0039916
21449        137.2621                 1.0                      136                  1.0039916
23204        137.2621                 1.0                      136                  1.0039916
24530        73.262108                1.0                      72                   1.0039916
25222        105.26211                1.0                      104                  1.0039916
26105        73.262108                1.0                      72                   1.0039916
26496        105.26211                1.0                      104                  1.0039916
27048        73.262108                1.0                      72                   1.0039916
28087        105.26211                1.0                      104                  1.0039916
32258        137.2621                 1.0                      136                  1.0039916
33750        105.26211                1.0                      104                  1.0039916
35606        73.262108                1.0                      72                   1.0039916
36395        73.262108                1.0                      72                   1.0039916
39768        137.2621                 1.0                      136                  1.0039916
40176        73.262108                1.0                      72                   1.0039916
40676        73.262108                1.0                      72                   1.0039916
43587        201.2621                 1.0                      200                  1.0039916
45413        73.262108                1.0                      72                   1.0039916
46450        137.2621                 1.0                      136                  1.0039916
46842        105.26211                1.0                      104                  1.0039916
48568        73.262108                1.0                      72                   1.0039916
49001        105.26211                1.0                      104                  1.0039916
49212        105.26211                1.0                      104                  1.0039916
50291        105.26211                1.0                      104                  1.0039916
50670        73.262108                1.0                      72                   1.0039916
51689        137.2621                 1.0                      136                  1.0039916
53767        137.2621                 1.0                      136                  1.0039916
54636        137.2621                 1.0                      136                  1.0039916
55889        73.262108                1.0                      72                   1.0039916
57068        137.2621                 1.0                      136                  1.0039916
57724        73.262108                1.0                      72                   1.0039916
58686        137.2621                 1.0                      136                  1.0039916
59809        73.262108                1.0                      72                   1.0039916
60554        105.26211                1.0                      104                  1.0039916
60839        73.262108                1.0                      72                   1.0039916
62141        137.2621                 1.0                      136                  1.0039916
63255        137.2621                 1.0                      136                  1.0039916
64476        105.26211                1.0                      104                  1.0039916
65518        73.262108                1.0                      72                   1.0039916
66445        73.262108                1.0                      72                   1.0039916
68157        105.26211                1.0                      104                  1.0039916
68370        73.262108                1.0                      72                   1.0039916
69083        105.26211                1.0                      104                  1.0039916
69704        73.262108                1.0                      72                   1.0039916
70245        73.262108                1.0                      72                   1.0039916
70792        105.26211                1.0                      104                  1.0039916
72240        137.2621                 1.0                      136                  1.0039916
72634        137.2621                 1.0                      136                  1.0039916
73852        137.2621                 1.0                      136                  1.0039916
74583        137.2621                 1.0                      136                  1.0039916
75658        137.2621                 1.0                      136                  1.0039916
76493        201.2621                 1.0                      200                  1.0039916
77960        137.2621                 1.0                      136                  1.0039916
80343        137.2621                 1.0                      136                  1.0039916
80664        73.262108                1.0                      72                   1.0039916
81429        137.2621                 1.0                      136                  1.0039916
81868        73.262108                1.0                      72                   1.0039916
83277        201.2621                 1.0                      200                  1.0039916
83551        73.262108                1.0                      72                   1.0039916
84590        73.262108                1.0                      72                   1.0039916
87201        137.2621                 1.0                      136                  1.0039916
87984        137.2621                 1.0                      136                  1.0039916
88429        73.262108                1.0                      72                   1.0039916
88531        73.262108                1.0                      72                   1.0039916
89888        137.2621                 1.0                      136                  1.0039916
90776        73.262108                1.0                      72                   1.0039916
91744        137.2621                 1.0                      136                  1.0039916
92530        73.262108                1.0                      72                   1.0039916
94314        137.2621                 1.0                      136                  1.0039916
96245        73.262108                1.0                      72                   1.0039916
96347        73.262108                1.0                      72                   1.0039916
97558        137.2621                 1.0                      136                  1.0039916
97762        137.2621                 1.0                      136                  1.0039916
99128        73.262108                1.0                      72                   1.0039916
99723        73.262108                1.0                      72                   1.0039916
99824        73.262108                1.0                      72                   1.0039916
100607       73.262108                1.0                      72                   1.0039916
100799       73.262108                1.0                      72                   1.0039916
102294       137.2621                 1.0                      136                  1.0039916
102843       73.262108                1.0                      72                   1.0039916
103864       73.262108                1.0                      72                   1.0039916
106083       137.2621                 1.0                      136                  1.0039916
107290       137.2621                 1.0                      136                  1.0039916
108629       73.262108                1.0                      72                   1.0039916
109514       73.262108                1.0                      72                   1.0039916
109649       73.262108                1.0                      72                   1.0039916
110757       137.2621                 1.0                      136                  1.0039916
111218       73.262108                1.0                      72                   1.0039916
111306       73.262108                1.0                      72                   1.0039916
111555       73.262108                1.0                      72                   1.0039916
111870       73.262108                1.0                      72                   1.0039916
114272       201.2621                 1.0                      200                  1.0039916
114832       73.262108                1.0                      72                   1.0039916
115608       73.262108                1.0                      72                   1.0039916
116097       73.262108                1.0                      72                   1.0039916
116423       73.262108                1.0                      72                   1.0039916
117211       137.2621                 1.0                      136                  1.0039916
117401       73.262108                1.0                      72                   1.0039916
118915       73.262108                1.0                      72                   1.0039916
119160       73.262108                1.0                      72                   1.0039916
121099       137.2621                 1.0                      136                  1.0039916
121314       73.262108                1.0                      72                   1.0039916
122305       137.2621                 1.0                      136                  1.0039916
122981       137.2621                 1.0                      136                  1.0039916
123970       137.2621                 1.0                      136                  1.0039916
124660       73.262108                1.0                      72                   1.0039916
125250       105.26211                1.0                      104                  1.0039916
125980       105.26211                1.0                      104                  1.0039916
127206       105.26211                1.0                      104                  1.0039916
127339       105.26211                1.0                      104                  1.0039916
128141       105.26211                1.0                      104                  1.0039916
130349       105.26211                1.0                      104                  1.0039916
130934       105.26211                1.0                      104                  1.0039916
131347       105.26211                1.0                      104                  1.0039916
131708       105.26211                1.0                      104                  1.0039916
132762       105.26211                1.0                      104                  1.0039916
133454       105.26211                1.0                      104                  1.0039916
133603       105.26211                1.0                      104                  1.0039916
134259       105.26211                1.0                      104                  1.0039916
135995       105.26211                1.0                      104                  1.0039916
136581       105.26211                1.0                      104                  1.0039916
137061       105.26211                1.0                      104                  1.0039916
137393       105.26211                1.0                      104                  1.0039916
139218       105.26211                1.0                      104                  1.0039916
139582       105.26211                1.0                      104                  1.0039916
140318       105.26211                1.0                      104                  1.0039916
141783       105.26211                1.0                      104                  1.0039916
142850       105.26211                1.0                      104                  1.0039916
144457       137.2621                 1.0                      136                  1.0039916
146519       137.2621                 1.0                      136                  1.0039916
149014       137.2621                 1.0                      136                  1.0039916
149763       137.2621                 1.0                      136                  1.0039916
151143       137.2621                 1.0                      136                  1.0039916
152962       265.26212                1.0                      264                  1.0039916
153623       137.2621                 1.0                      136                  1.0039916
154471       137.2621                 1.0                      136                  1.0039916
155504       137.2621                 1.0                      136                  1.0039916
157561       137.2621                 1.0                      136                  1.0039916
157818       137.2621                 1.0                      136                  1.0039916
159162       137.2621                 1.0                      136                  1.0039916
159900       137.2621                 1.0                      136                  1.0039916
160555       137.2621                 1.0                      136                  1.0039916
161136       137.2621                 1.0                      136                  1.0039916
162073       137.2621                 1.0                      136                  1.0039916
162854       137.2621                 1.0                      136                  1.0039916
164077       137.2621                 1.0                      136                  1.0039916
166128       137.2621                 1.0                      136                  1.0039916
167134       137.2621                 1.0                      136                  1.0039916
167627       137.2621                 1.0                      136                  1.0039916
167910       137.2621                 1.0                      136                  1.0039916
168894       137.2621                 1.0                      136                  1.0039916
170659       137.2621                 1.0                      136                  1.0039916
171700       265.26212                1.0                      264                  1.0039916
172916       137.2621                 1.0                      136                  1.0039916
173504       137.2621                 1.0                      136                  1.0039916
173922       137.2621                 1.0                      136                  1.0039916
175101       137.2621                 1.0                      136                  1.0039916
176125       137.2621                 1.0                      136                  1.0039916
177383       137.2621                 1.0                      136                  1.0039916
178150       137.2621                 1.0                      136                  1.0039916
178726       137.2621                 1.0                      136                  1.0039916
180174       137.2621                 1.0                      136                  1.0039916
180678       137.2621                 1.0                      136                  1.0039916
181270       137.2621                 1.0                      136                  1.0039916
182690       137.2621                 1.0                      136                  1.0039916
186210       265.26212                1.0                      264                  1.0039916
187417       137.2621                 1.0                      136                  1.0039916
187450       42.262104                1.0                      42                   1.0039916
187451       10.262105                1.0                      10                   1.0

(189 row(s) affected)

DBCC execution completed. If DBCC printed error messages, contact your system administrator.