on 11-06-2012 10:08 AM
Hi,
SAP has just concluded Go-Live Checks service on our ECC system. They found out that there was an access on BDCP2 causing high database load:
SQL Statement
SELECT
"MANDT", "MESTYPE", "CPIDENT", "PROCESS", "TABNAME", "TABKEY", "FLDNAME", "CRETIME", "ACTTIME", "USRNAME", "CDOBJCL", "CDOBJID", "CDCHGNO", "CDCHGID"
FROM
"BDCP2"
WHERE
"MANDT"=:A0 AND "MESTYPE"=:A1 AND "PROCESS"=:A2
ORDER BY
"MANDT", "CPIDENT"
For this, their Recommendation: Increase the number of distinct values for the field PROCESS in the index BDCP2~001 from 2 to 100. Please test this recommendation and review performance.
How to implement their recommendations (i.e., increase the number of distinct values for the field PROCESS) ?
Any clues would be helpful.
Thanks,
Abdul
There's a much simpler way to go about this - follow SAP note 1020260. Run the script, create new stats on BDCP2, done.
That script raises the distinct count to 10, which should be plenty, it's published by SAP and kept uptodate and won't be forgotten in one year when the same problem will resurface because new stats were created on BDCP2 by some other method...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Abdul,
it is pretty amusing to read all of that Early Watch reports or SAP Go Live checks. What a nice (useless) cash print machine.
However lets continue with your question. You can not manipulate the distinct value statistic from a column in an index (exception the column PROCESS is the only one in the index). The distinct values are stored in the column statistics area and not in the index statistics (excluding the exception). I will disregard histograms and different version behaviors right now to keep int simple.
shell> sqlplus / as sysdba
SQL> exec DBMS_STATS.SET_COLUMN_STATS('<SCHEMA_OWNER>','BDCP2','PROCESS', distcnt => 100);
SQL> exec DBMS_STATS.UNLOCK_TABLE_STATS('<SCHEMA_OWNER>','BDCP2');
However this should not be a solution - just a work around (if it works).
Regards
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Best viewable:
ST05 -> EXPLAIN a single statement
Enter as statement
SELECT * FROM BDCP2
press explain
The plan will surely be a full table scan on the table, never mind.
Doubleclick the table name in the EXPLAIN to get the stats details.
Better: put your above statement into ST05 and check before and after your stats change,
how this will affect the execution plan.
Volker
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.