Saturday, February 25, 2012

Query not using the right index

Hi,
Since a day, Queries that run on a specific
table "Transit" are not using the right index.
I need to add "with (index=X2,readuncommitted)" to the
query to ensure it uses the right one.
The first thing i should do is to REINDEX the table.
BUT, is there something else (less long) i could do
instead of REINDEX ?
Thanks,
DonHi,
Verify before something if the order (ASC or DESC) of the index is attended.
If not, try using the following command: "dbcc freeproccache" that will
free your procedures cache.
[ ]'s
PEDRO HENRIQUE NUNES - Brasil
"Donald" <Donald.huppe@.bocenor.com> wrote in message
news:0d2301c3721e$c3577560$a101280a@.phx.gbl...
> Hi,
> Since a day, Queries that run on a specific
> table "Transit" are not using the right index.
> I need to add "with (index=X2,readuncommitted)" to the
> query to ensure it uses the right one.
> The first thing i should do is to REINDEX the table.
> BUT, is there something else (less long) i could do
> instead of REINDEX ?
> Thanks,
> Don|||If reindexing works, then most likely running UPDATE STATISTICS will
solve the problem as well.
Gert-Jan
Donald wrote:
> Hi,
> Since a day, Queries that run on a specific
> table "Transit" are not using the right index.
> I need to add "with (index=X2,readuncommitted)" to the
> query to ensure it uses the right one.
> The first thing i should do is to REINDEX the table.
> BUT, is there something else (less long) i could do
> instead of REINDEX ?
> Thanks,
> Don

No comments:

Post a Comment