Hello folks,
I'm really at a loss here and Im hoping you can help.
I several queries that join a number of indexed tables by various id
numbers that are used to pull up only a couple rows (so I think
selectivity is high). The tables are all in the 2000 - 50000 range in
number of rows.
When we run the following ANALYZE statement for each table and run the
qeries through the optimizer we see that we have several FULL scans on
several tables that do have indexes on the fields being queried.
Though we have FULL scans the queries run very fast.
ANALYZE TABLE xxx Estimate statistics sample 20 percent;
On the flip side if we do this oher ANALYZE statement for each table
and run them through the optimizer we see that each table either has
INDEX ROWID or UNIQUE SCAN. This plan which is hitting the indexes
runs much slower than it's counterpart.
ANALYZE TABLE xxx Delete statistics;
Why is the query with the full scans faster? When are FULL scans
usually acceptable? From what I understand about RBO/CBO is that when
the statistics are deleted we are forcing the optimizer to use RBO.
When we create the statistics we are using CBO.