?
Solved

The different in execution plan

Posted on 2012-03-29
6
Medium Priority
?
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 15

Assisted Solution

by:Anuj
Anuj earned 500 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 500 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 1000 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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 1000 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
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 to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

752 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