ert-Jan, Thanks a lot for your answers!
If I'm using a compound index on (EVENT_DATE, EVENT_TYPE), and then I'm
running a query which retrieves rows from a specific range of dates, but
without restriction on the EVENT_TYPE, will the optimizer be able to use
At first I thought the answer is yes:
But later you advice me to choose option , which means having both:
a. index on EVENT_DATE
b. index on EVENT_TYPE
c. compound index (EVENT_DATE, EVENT_TYPE)
Why do I need the seperate indexes on EVENT_DATE (a) and EVENT_TYPE (b) if I
have a compound index on (EVENT_DATE, EVENT_TYPE) (c)?
I think that this is necessary only if the user runs queries which are using
only EVENT_TYPE restriction and not EVENT_DATE restriction (since such
queries cannot use the (EVENT_DATE, EVENT_TYPE) index because of the order
of the fields in the index). Is that correct?
I can assure that the users will not run any 'wide' queries without dates
restriction, so that I can assure the EVENT_DATE will always be in the WHERE
clause. In that situation can I not use the seperate indexes on EVENT_DATE
and EVENT_TYPE at all, and use only the compound index instead (assuming the
EVENT_DATE will always be in the WHERE clause, and that the EVENT_TYPE will
be used if needed, according to the user's query and the statistics)?
"Gert-Jan Strik" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...