Oracle Power for Index Use

Is there a way to force oracle to use an index other than hints?

+4
source share
5 answers

Not. And if the optimizer does not use an index, it usually has a good reason. Using an index, if the index is bad, can actually slow down your queries.

+7
source

Oracle does not use an index if it considers the index

  • disconnected
  • invalid (for example, after a huge data load and index statistics have not been updated)
  • will not help (for example, when in 5 million lines there are only two different values)

So, the first thing to check is that the index is enabled, then execute the correct GATHER command in your index / table / schema. When this does not help, Oracle believes that loading your index will take longer than loading the actual row values. In this case, add more columns to the index to make it more "diverse."

+7
source

You can take a look at the outlines of the oracle. You can take an existing query and create a saved path and configure the query in the same way as prompts. It is very difficult to use. Do some research before you decide to implement saved contours.

You can add tooltips to the query, which will make it look more profitable by one index over another index.

In general, if you have compiled good statistics on all tables and indexes, Oracle usually implements very good execution plans.

+1
source

If your query does not include the indexed field in its conditions, then the database would be foolish to use an index. So I'm the second Donnie to answer.

0
source

Yes, technically you can force Oracle to use the index (without prompts) in one scenario: if the table is an indexed table, then logically the only way to query the table is through the index, because there is no table to query.

0
source

All Articles