on 09-30-2012 9:51 AM
Dear Team,
I meet one issue ,when I write the SQL in the ST05 and click the Explain Plan in the CRM system:
It doesn't use the index CRM_JEST~0 and Then I use the HINT to USE the CRM_JEST~0,but it doesn't work.
Could you pls tell me why?
I try to execute in SE11 it really goes faster than lighter less than 1 seconds.
Hello Neil,
well at first i have to mention three very important points:
Point 1 (and maybe in combination with point 2) is probably the reason why the SQL runs fast by SE16 (and SE16 uses a ROWNUM clause and FIRST_ROW HINT as well in your case).
However the HINT should be recognized in any case. Can you please try to put the table and index name in the " tags like ("CRM_JEST" "CRM_JEST~0"). This issue is SAP specific due to the special characters in object names.
I have written a blog about the the bind / literal behavior in a SAP environment (maybe you are interested): http://scn.sap.com/community/oracle/blog/2012/08/03/oracle-db-optimizer-part-i--understanding-in-lis...
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Koehler,
Thanks for your professional reply. I have tried to use the hint ("CRM_JEST" "CRM_JEST~0").It still doesn't work.
Then I try to run the same SQL in the Test system.It truely use the correct index.I check the table size and cluster factor and statistic information all the same.
Could you pls kindly have a look and give some recommendation?
Thanks,
Neil
SQL:
Select
T0.header
From crmd_order_index t0 inner join CRMD_ORDERADM_H t1 on
T0.client = t1.client and t0.header = t1.GUID
inner join CRM_JEST t2 on
T0.client = t2.MANDT and T0.header = T2.OBJNR
Where t1.PROCESS_TYPE IN ('ZCMP','ZDMP')
AND t0.SALES_ORG IN ('O 50001104','O 50001105')
AND t0.SERVICE_ORG IN ('O 50004212','O 50004221')
AND t1.ZZAFLD00000D IN ('01','02','03','04','05','08','09','11')
AND t2.STAT IN ('E0001', 'E0002', 'E0003', 'E0004')
And t0.OBJECT_TYPE = 'BUS2000120'
And t0.client = '800'
AND t2.INACT = ' '
Hello Neil,
that is a complete different SQL as your previous one (note the table alias T2 for example - you need to use that in the HINT syntax).
However two more important points to mention:
The screenshots are too small (or my eyes are too bad ), but as far as i can see there is a huge difference in the row estimation. Such issues can hardly be analyzed and fixed through a forum.
If you need further analysis or assistance - please check my profile / homepage. I have specialized on such (short-term) requests.
Regards
Stefan
The screenshots are too small (or my eyes are too bad ), but as far as i
Ja, I see that the same way.
Just for Information to all people that like to provide stats:
Rightclick the stats box and use "SAVE to FILE" and in the following box "SAVE TO CLIPBORAD"
When putting it into SDN, format as Courier New -> voila
As for the EXPLAIN:
The OBJNR seems to be a guid and there is a common bug in the EXPLAIN with GUIDs.
It is only for the explain, the select itself is doing it properly.
To get the "correct" explain in ST05, you need to add the hextoraw() function to the SQL,
allthough it is not in the original SQL. (SAP note 551400).
GUID-Where compares tend to display Full Table Scans in ST05,
but do not worry, they are doing not!
You should also check regional settings, as the date format in both stats screens differs.
I am not aware of any bug or configuration that would make a difference in this case,
but one never knows, so I would like to have it identical...
Volker
In addition to above suggestions please check oracle versions with installed patches on both systems. May be this issue related to oracle CBO bugs. If you have no more idead you can try to trace optimizer plan.
Regards
Roman
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Neil,
First of all check the database statistics have been collected without a problem on DB13. Additionally, try to update stats with DB20 and try to execute the query and check the results.
>> I try to execute in SE11 it really goes faster than lighter less than 1 seconds.
Could it be the reason that you executed the query on SE11 with the default values? By the default values, first 500 rows fetched from the database and presented. So, because of the other query does not have a restriction, its runtime is longer than SE11.
Best regards,
Orkun Gedik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.