SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Execution plan


Execution plan

Author
Message
Oracle_91
Oracle_91
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5226 Visits: 1742
Hi All,

I have 2 sql sevr 2005 instances with same build no,same edition.

I restored the database from one insatnce to another instance. But when i execute the same query in the second instance , it poduces are different plan and my query performance is slow now on one instance.

Just wanted to understand how sql server or on what factors/basis sql servr produces are different plans if my stats are same ?

Thanks in Advance.
Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)SSC Guru (150K reputation)

Group: General Forum Members
Points: 150808 Visits: 39285
Oracle_91 (9/10/2012)
Hi All,

I have 2 sql sevr 2005 instances with same build no,same edition.

I restored the database from one insatnce to another instance. But when i execute the same query in the second instance , it poduces are different plan and my query performance is slow now on one instance.

Just wanted to understand how sql server or on what factors/basis sql servr produces are different plans if my stats are same ?

Thanks in Advance.





Are there any differences in how the instances are configured? Are the instances on the same server or different servers? If different servers, how are these servers configured?

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Oracle_91
Oracle_91
SSCertifiable
SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)SSCertifiable (5.2K reputation)

Group: General Forum Members
Points: 5226 Visits: 1742
Both are two different server with configuration. But on the second servers there are 2 instances.
One more thing, the second is not at all running on the second box.
Jason Selburg
Jason Selburg
SSChampion
SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)SSChampion (10K reputation)

Group: General Forum Members
Points: 10153 Visits: 4131
Did you rebuild statistics?

I do believe that even though the servers may be configured the same/same hardware, when you restore a database the stats get "out of whack".


I may be wrong, and if I am someone will most likely point it out here. w00t

______________________________________________________________________

Personal Motto: Why push the envelope when you can just open it?

If you follow the direction given HERE you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
Orlando Colamatteo
Orlando Colamatteo
SSC Guru
SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)

Group: General Forum Members
Points: 69700 Visits: 14494
Jason Selburg (9/12/2012)
Did you rebuild statistics?

I do believe that even though the servers may be configured the same/same hardware, when you restore a database the stats get "out of whack".


I may be wrong, and if I am someone will most likely point it out here. w00t

A restore will not affect the statistics. A restore gives us an exact page-for-page database as existed when the database was backed up.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Orlando Colamatteo
Orlando Colamatteo
SSC Guru
SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)SSC Guru (69K reputation)

Group: General Forum Members
Points: 69700 Visits: 14494
Oracle_91 (9/10/2012)
Hi All,

I have 2 sql sevr 2005 instances with same build no,same edition.

I restored the database from one insatnce to another instance. But when i execute the same query in the second instance , it poduces are different plan and my query performance is slow now on one instance.

Just wanted to understand how sql server or on what factors/basis sql servr produces are different plans if my stats are same ?

Thanks in Advance.




If the optimizer chooses a parallel plan that could account for a difference. Can you please post both execution plans attached to this thread as .sqlplan files?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Bhuvnesh
Bhuvnesh
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21542 Visits: 4079
there could be some hardware allocation differnce like memory or cpu OR sme diiferent setting like maxdop etc

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search