Influence assumed number of rows
create table tq84_opt_est (
num number,
txt varchar2(10)
);
explain plan for
select
/*+
opt_estimate(table tq84_opt_est rows=12345)
*/
num,
txt
from
tq84_opt_est;
select * from table(dbms_xplan.display(format=>'basic +rows'));
--
-- --------------------------------------------------
-- | Id | Operation | Name | Rows |
-- --------------------------------------------------
-- | 0 | SELECT STATEMENT | | 12345 |
-- | 1 | TABLE ACCESS FULL| TQ84_OPT_EST | 12345 |
-- --------------------------------------------------
drop table tq84_opt_est;