Home > Archive > MS SQL Server > February 2006 > Statistics









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Statistics
Rodolfo García Acuña

2006-02-13, 7:23 am

Hi

I would like to know what purpose have the Statistics in SQL. I have tried
to look about this topic, but I can't find anything that explains or simply
I can´t understand the real use of this.
Thanks

--
Ing. Rodolfo García Acuña
TEZE, S.A. de C.V.
(33) 3615 - 0210
Email: rgarcia.gdl@teze.com.mx
MSN: chundos@hotmail.com


Mike Hodgson

2006-02-13, 7:23 am

Simple explanation: They're used by the query optimiser when compiling a
query plan. They help the optimiser decide how best to retrieve the
data in the tables based on the density & distribution of that data
within the available indexes.

More complete & accurate info:
Statistics Used by the Query Optimiser in Microsoft SQL Server 2005
<http://www.microsoft.com/technet/pr...5/qrystats.mspx>
by Eric Hanson

--
*mike hodgson*
http://sqlnerd.blogspot.com



Rodolfo García Acuña wrote:

>Hi
>
>I would like to know what purpose have the Statistics in SQL. I have tried
>to look about this topic, but I can't find anything that explains or simply
>I can´t understand the real use of this.
>Thanks
>
>
>


Uri Dimant

2006-02-13, 7:23 am

Hi
Shortly, SQL Server keeps statistics on columns in order to create a more
efficient execution plan ( using inedexes)





"Rodolfo García Acuña" <rgarcia.gdl@teze.com.mx> wrote in message
news:u993FTFMGHA.1536@TK2MSFTNGP11.phx.gbl...
> Hi
>
> I would like to know what purpose have the Statistics in SQL. I have tried
> to look about this topic, but I can't find anything that explains or
> simply I can´t understand the real use of this.
> Thanks
>
> --
> Ing. Rodolfo García Acuña
> TEZE, S.A. de C.V.
> (33) 3615 - 0210
> Email: rgarcia.gdl@teze.com.mx
> MSN: chundos@hotmail.com
>



amish

2006-02-13, 7:23 am

http://www.sql-server-performance.com/statistics.asp.

Regards
Amish Shah

Tibor Karaszi

2006-02-13, 7:23 am

And another really short way of putting it:

Consider below two WHERE clauses:

WHERE lastname = 'Smith'
WHERE lastname = 'Karaszi'

How would the optimizer know how many Smith and Karaszi there are? There might be a lot of Smith in
the table and very few Karaszi. So it might not be efficient to use an index on the last name column
when searching for Smith, but very efficient when searching for Karaszi. This type of situations is
when the optimizer is really helped by statistics. Statistics will tell the optimizer the
distribution of the data for a column (typically the first column in an index).

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/

Blog: http:// solidqualitylearning
.com/blogs/tibor/



"Rodolfo García Acuña" <rgarcia.gdl@teze.com.mx> wrote in message
news:u993FTFMGHA.1536@TK2MSFTNGP11.phx.gbl...
> Hi
>
> I would like to know what purpose have the Statistics in SQL. I have tried to look about this
> topic, but I can't find anything that explains or simply I can´t understand the real use of this.
> Thanks
>
> --
> Ing. Rodolfo García Acuña
> TEZE, S.A. de C.V.
> (33) 3615 - 0210
> Email: rgarcia.gdl@teze.com.mx
> MSN: chundos@hotmail.com
>


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com