Friday, April 12, 2013

Force Oracle to recalculate execution plan for a table

Steps to force Oracle to recalculate execution plan for tables:

EXEC DBMS_STATS.GATHER_TABLE_STATS('<Schema_name>','<Table_name>'); 



-- deprecated approach
ANALYZE table <SCHEMA_NAME>.<TABLE_NAME> compute statistics;

and, DBMS_STATS.GATHER_TABLE_STATS is preferable (source: link, oracle-link)

No comments:

Post a Comment