06-10-2011 3:37 PM
Hi,
I'm having the below QUERY on CDHDR which take a <bowdlerized> lot of time:
SELECT OBJECTCLAS
OBJECTID
CHANGENR
TCODE
UDATE
UTIME
INTO TABLE IT_CDHDR2
FROM CDHDR
WHERE OBJECTCLAS = C_OBJECT
AND OBJECTID = C_OBJECT
AND ( TCODE = C_TCODE1 OR
TCODE = C_TCODE2 ).
Then I've the other select query on CDPOS using for all entries on IT_CDHDR2. Both the queries are taking a lot of time.in the CDPOS select query I'm passing all the keys in order while I couldn't do that for CDHDR. Kindly advise if anyone has worked on the performance issues with CDHDR/CDPOS. What are all the possible ways of improving the performance of CDHDR / CDPOS.
Thanks:
Gaurav
Edited by: Rob Burbank on Jun 10, 2011 3:00 PM
06-10-2011 3:50 PM
G,
Ask your DBAs when was the last time that they ran "stats" on CDHDR and CDPOS.
Running stats optimizes performance when accessing a table.
06-10-2011 5:02 PM
Hello Gaurav,
basically John was right.
Table CDHDR has first key fields MANDT, OBJECTCLAS, OBJECTID.
Object ID is normally selective enough to provide good performance for the select that you mentioned.
The only reason that comes to my mind is the outdated statistics.
When the database decides whether to make an index scan or a full table scan, it looks at the table statistics (number of rows, selectivity, etc.). Tables like CDHDR grow after GoLive of the system. If the statistics was last collected when this table was small, the database will think that it will be cheaper to do a full table scan. And it is not the case anymore.
Please go to the transaction DB20 and update statistics for CDHDR and CDPOS tables.
See if it helps.
Regards,
Yuri
06-10-2011 6:11 PM
Hi John/Yuri,
I'll just check on that & update you on this. Thanks for your response.
Thanks:
Gaurav
06-10-2011 7:21 PM
Hi Gaurav,
Please check the FM - CHANGEDOCUMENT_READ_HEADERS
You can read the document of this FM also.
For CDPOS
The FM - CHANGEDOCUMENT_READ_POSITIONS
Read the documenatation.
It may help the performance.
06-14-2011 11:22 AM
Hi
See the report RSSCD100. It isn't slow. It will give ideas how to solve it.
Regards
Eduardo
06-29-2011 8:51 PM
Hi,
Try Naresh Nelapatla's answer. I had same issue some time back and tried those FM and performance was good compared to direct fetch.
Thanks,
Jagadish
07-29-2011 11:25 AM