…or…faking the stats so the CBO because your production system has 10M rows in the larger tables but you simply don’t have room for this in your test and QA systems. How do you get Oracle to think there are 10M rows when there are really only 100,000 rows? Using DBMS_STATS of course. Exec DBMS_STATS.SET_TABLE_STATS(OWNNAME=>’TEST’, TABNAME=>’EMP’, NUMROWS=>1000000, NUMBLOCKS=>4000); There are similar commands to tweek the index stats. Upside: this will give the CBO a better idea on the test system the row counts to consider. The downside is you still won’t get the exact same explain plan as you do in production, but it will be a lot closer. Dan Hotka Oracle ACE Director Instructor/Author/CEO
↧