Different execution plan in Different DB [message #590613] |
Sat, 20 July 2013 06:18 |
|
sss111ind
Messages: 636 Registered: April 2012 Location: India
|
Senior Member |
|
|
Hi All,
Why the query is behaving differently with the different database.(execution plan)
Whatever the production database is having same database instance replicated to a new schema.
I tried both the queries running on both environment.In prod the index has been used but in newdev it is not.
This case existing primary key index were not been used.
What might be the issue.
Regards,
Nathan
[Updated on: Sat, 20 July 2013 06:20] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Different execution plan in Different DB [message #590655 is a reply to message #590613] |
Sun, 21 July 2013 05:22 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
sss111ind wrote on Sat, 20 July 2013 16:48In prod the index has been used but in newdev it is not.
1. The stats might be different between the two environments, hence the optimizer behaves differently. The optimizer can only use the information that is provided to it. If the stats it uses are incorrect, old, or skewed then the optimizer stays unaware about it, it is more likely to choose an inefficient plan for fetching the data.
2. Even if the data is same, there are lot of other things on which the performance depends, like the initialization parameters etc. Since you say it is "newdev", I am sure it won't be same as that of production.
[Updated on: Sun, 21 July 2013 05:28] Report message to a moderator
|
|
|