Solved

The different in execution plan

Posted on 2012-03-29
6
276 Views
Last Modified: 2012-04-23
Dear all expertist,

Right now we found out that one SQL SP is running good on test/QA platform but not on production, may I know what can cause this?

I knew that different:
1)Code
2) schema
3) index

can cause this, what else ?

I think I need to update statistics at the first step to see if it helps.

I don't want to go for a hard way.

DBA100.
0
Comment
Question by:marrowyung
6 Comments
 
LVL 15

Assisted Solution

by:Anuj
Anuj earned 125 total points
ID: 37781359
Compare the execution plans of both QA and Production, and confirm the same indexes are used. Next step is to check the fragmentation of your indexes, and update your statistics.
0
 
LVL 7

Accepted Solution

by:
waltersnowslinarnold earned 125 total points
ID: 37781478
Check it the Query in the SP is using multiple INDEX at the same time, if so force an INDEX in the code, which would let the Query to consider only the INDEX forced rather multiple.

Yet same problem persists, plz go ahead with update statistics
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 250 total points
ID: 37793715
>>one SQL SP is running good on test/QA platform but not on production, may I know what can cause this?<<
Production has more data that QA and the Stored Procedure has not been optimized.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 1

Author Comment

by:marrowyung
ID: 37794749
acperkins,

the production will always has more data then QA.

It is the same SP being different when running on production and QA, I would like to see why .

anujnb,

What if execution plan is not the same? "check the fragmentation of your indexes," can be done by rebuilting  index but our DB has run for a long time and it just start to happen


waltersnowslinarnold,

how to "force an INDEX in the code"?

DBA100.
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 250 total points
ID: 37802820
It is the same SP being different when running on production and QA, I would like to see why .
And again, that would be because in production you have more data and the query has not been optimized.  This means that the Execution Plans are different.  When you can wrap your head around that we can try and help you more.
0
 
LVL 7

Expert Comment

by:waltersnowslinarnold
ID: 37805540
You could force an INDEX in the following manner;

syntax;

SELECT
col1, col2, . . .
FROM tableName WITH (INDEX(indexName))
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now