Re: UPDATE STATISTICS questions
Posted in 1999
Topics: Data Types & Schema Design
>1) Are distributions created only by UPDATE STATISTICS MEDIUM or HIGH?
Yes the distributions are created only by UPDATE STATISITICS MEDIUM or HIGH.
Update statistics MEDIUM creates distribution by obtaining the random sample ofthe rows in the table.
Whereas Update statistics HIGH creates distribution by reading each row in the
table.
> 2) Is UPDATE STATISTICS HIGH or MEDIUM followed by dropping distributions
the same result as just doing UPDATE STATISTICS LOW? If not, what are the
differences?
No. They are not the same. Just doing UPDATE STATISTICS LOW will not drop the
existing distribution on table. The dropping of the distribution should be
explicitly specified. It can be specified for the entire table or for a
particular column of table for which distribution was created. Otherway around
is , altering the data type or size of the column will drop distribution.
Moreover , if the column is dropped, the distribution is dropped.
Hi gurus : please let me know your comments / opinions too.
Harinath Venkata
Svenska Handelsbanken
New York
have01@handelsbanken.se wrote:
>
> >1) Are distributions created only by UPDATE STATISTICS MEDIUM or HIGH?
>
> Yes the distributions are created only by UPDATE STATISITICS MEDIUM or HIGH.
> Update statistics MEDIUM creates distribution by obtaining the random sample of> the rows in the table.
> Whereas Update statistics HIGH creates distribution by reading each row in the
> table.
>
> > 2) Is UPDATE STATISTICS HIGH or MEDIUM followed by dropping distributions
> the same result as just doing UPDATE STATISTICS LOW? If not, what are the
> differences?
>
> No. They are not the same. Just doing UPDATE STATISTICS LOW will not drop the
> existing distribution on table. The dropping of the distribution should be
> explicitly specified. It can be specified for the entire table or for a
> particular column of table for which distribution was created. Otherway around
> is , altering the data type or size of the column will drop distribution.
> Moreover , if the column is dropped, the distribution is dropped.
Correct. Also note that I have found that MEDIUM does not update the
index level stats in sysindexes only LOW and HIGH do that!
Art S. Kagel