I have attached two query plans , which are generated by Production server
at different times (1 day apart). ( i could not send mail with attached
plans I had to remove them)
Same query I have executed every day over two weeks time to see how the
query is performing in prod. server. I got two different plans. I didnt
understand how come the plan is changing so drastic when there are not many
data updates on the tables referred in the query. These tables are very
static and i am running dbcc reindex every night on these tables. Plan 1 has
index scan which is taking long time to execute (11 Sec), Plan 2 has no
index scan and so it is executing fast (<200ms). I didnt get a clue why it
is going for index scan some time and no index scan other times. I hope some
one will have answer for it.
Windows 2000 Server/SQL Server 2000 Standard SP4, 2 cpu, 1GB RAM, RAID 1
Disk
Thanks,
Subbu.Statistics can influence the plan choice. Not all stats are tied to
indexes. So, you likely will want to make sure that all statistics are
up-to-date before making any conclusions. (update statistics <tablename>)
If you are close to a boundary between two plan choices, small changes can
push you from one plan to another on a recompile.
Hope that helps,
Conor
"subbu" <subbaiahd@.hotmail.com> wrote in message
news:%23wq2y6NWGHA.1192@.TK2MSFTNGP03.phx.gbl...
> Plan 1: No index SCAN
> Plan 2: Index SCAN
> I had to send in two separate mail as it crossed max limit size
> Thanks,
> Subbu.
> "subbu" <subbaiahd@.hotmail.com> wrote in message
> news:%238V3L3NWGHA.4212@.TK2MSFTNGP03.phx.gbl...
>> I have attached two query plans , which are generated by Production
>> server
>> at different times (1 day apart). ( i could not send mail with attached
>> plans I had to remove them)
>> Same query I have executed every day over two weeks time to see how the
>> query is performing in prod. server. I got two different plans. I didnt
>> understand how come the plan is changing so drastic when there are not
> many
>> data updates on the tables referred in the query. These tables are very
>> static and i am running dbcc reindex every night on these tables. Plan 1
> has
>> index scan which is taking long time to execute (11 Sec), Plan 2 has no
>> index scan and so it is executing fast (<200ms). I didnt get a clue why
> it
>> is going for index scan some time and no index scan other times. I hope
> some
>> one will have answer for it.
>>
>> Windows 2000 Server/SQL Server 2000 Standard SP4, 2 cpu, 1GB RAM, RAID 1
>> Disk
>>
>> Thanks,
>> Subbu.
>>
>>
>>
>
>