on 01-06-2015 5:17 PM
We have a program written with the following SQL:
SELECT *
FROM ztableX
INTO TABLE li_ztableX
FOR ALL ENTRIES IN li_ztableY
WHERE werks EQ li_ ztableY -werks
AND order EQ li_ ztableY -order
AND work_cen EQ li_ ztableY -work_cen
AND deleted EQ space.
The key for the ztableX table has many fields. We have one index created for werks, order
and work_cen. I ran a trace of the program and found that the optimizer is not using the index.
There are values in all three fields.
I checked the index via the dbacockpit--> Database Objects path and found that the index is valid and active.
I also reviewed SAP help and SCN and could not find any solutions.
We are using MAXDB 7.9.08.009
Do you have any advice on why it is not using the index? What else should I look for?
Regards,
Steve
Hello Steve,
you can use a database hint in the abap query to force the optimizer to use your index as documented in SAP Note 832544 - FAQ: SAP MaxDB hints
%_HINTS ADABAS 'INDEXACCESS ("ZTABLEX~YOUR_INDEX")'
Regards,
Valerio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Steve,
if this is a SAP system, I would recommend ceating a support ticket on BC-DB-SDB for this as it would make the problem analysis easier for us. If you let me know the incident#, I could to speed up the processing time somewhat.
In any case, to proceed here, we would need the excution plan and the SQL statement, preferredly collected via R/3 transaction ST05. Plus the table definition and the index definition.
Regards,
Thorsten
PS:
Your database patch level is quite old, I would recommend patching it to a current release (although there is no indication it would change anything about your curremt SQL issue).
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 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.