Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: using indexes
In article <90ol0s$1qcsm$5_at_ID-62141.news.dfncis.de>,
"Sybrand Bakker" <postbus_at_sybrandb.demon.nl> wrote:
> That is exactly why Oracle has a built-in optimizer.
> If you create histograms for your data, it will automatically
> use a full table scan when more than 5 percent of the table
> needs to be read. You can create histograms by issuing
> analyze table <table_name> compute statistics for all indexed columns.
I've found that the optimizer does not always make the right decision however, which is why Oracle gave us optimizier hints. Sometimes it decides not to use an index when in reality, using the index is faster. It's true that the higher the cardinality of values in the index, the more efficient it will be. You can also use bitmap indexes to deal with columns of low cardinality that you really want to index, but bitmap indexes get messed up fast and need to be rebuilt if the table's contents change frequently.
-Dave
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Thu Dec 07 2000 - 13:08:09 CST