[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

The different in execution plan

Posted on 2012-03-29
6
Medium Priority
?
286 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
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.

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

649 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