Is it important to have histogram on columns of small table ?
Hi,
Yesterday , I was discussing a query performance issue with my fellow DBA, when he said that :
If a small table Small_table(10 rows) is part of complex query :
- we must have stats gathered on that column ( small_table.c1 ) otherwise CBO will not be able to understand the cardinality of predicate column of that small table and may produce wrong execution plan.
i.e
Yesterday , I was discussing a query performance issue with my fellow DBA, when he said that :
If a small table Small_table(10 rows) is part of complex query :
- we must have stats gathered on that column ( small_table.c1 ) otherwise CBO will not be able to understand the cardinality of predicate column of that small table and may produce wrong execution plan.
i.e
Select .....he says that histogram is must on small_table.c1 even if there are 2 rows satisfying the condition "small_table.c1 in ('A','B')" in 10 row table.
From big_table1,
big_table2,
medium_table1,
medium_table1,
Small_table
where ......and small_table.c1 in ('A','B') ;
0