Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Faking Oracle statistics?

Is there a way to force the Oracle too "see" a table and associated indexes as being bigger than they really are?

In other words, is there a way to "fake" database statistics, so the cost based optimizer would make decisions on a nearly-empty database, that are closer to decisions that would be made in a real, big production database?

The idea is to be able to experiment (vis-a-vis execution plan) with various indexing / querying / (de)normalization strategies very early in the database design process, without wasting time writing code that fills it with representative test data (most of which will end-up being discarded anyway, since the database design is still not settled).

Importing statistics is out of question, since the production database does not even exist yet.

like image 338
Branko Dimitrijevic Avatar asked Aug 18 '11 22:08

Branko Dimitrijevic


1 Answers

Sure. The DBMS_STATS package has a number of procedures that allow you to force statistics on objects. There are dbms_stats.set_table_stats and dbms_stats.set_index_stats procedures, for example.

like image 146
Justin Cave Avatar answered Nov 07 '22 02:11

Justin Cave