Re: index question
Posted in 1999
>Hi everybody:
>
> I execute in a regular way a query like this:
>
> select distinct A from T where B='string'>
> where de field A is an integer and field B is a char(8). The
>table is about 200.000 records length. Ther are about 5 or 6 distinct
>on fieldB, and about 20 distinct values on fieldA. What index should I
>create to improve the perfomance?
At a stab, I'd create an index on (B, A) which might make it a key-only
query. But I'm not sure if there's enough "uniqueness" to justify
indexing. Try it and see.
> Another question, after creating an index is necessary to
>execute update statistics for the table?
Only after a mass update or delete. (And on a regular basis anyway! :)
HTH.
--
"I'll Be Back"
Obnoxio
************************************************
Sane? Hell, if I was sane, why would I be here?
Get Your Private, Free Email at http://www.hotmail.com