Index not being used for Min/Max [message #345433] |
Wed, 03 September 2008 10:22 |
GreekBoy
Messages: 1 Registered: September 2008
|
Junior Member |
|
|
Hello pals, I have a major problem with a table of about 12M records.
The table contains a Date field (non-unique) with an index on it.
Through the Plan explanation facility, I notice that when I select the MIN or MAX value of the Date field, a full table scan is followed. But, when I select the MIN or MAX value of the integer primary key of the table, the relevant index is being used.
Is this normal? Why doesn't Oracle take advantage of the sorted index to find the values instantly; Am I doing something wrong?
Update: I just noticed that when the table contains considerably less records (arround 1 million), the index is being correctly used also for the case of the Date field...
|
|
|
|
|
|
|