Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Can I define an index for a select statement.
Indexes work by matching from the Left most portion of the index. The
secondary index would/could be used if you had specified order by
InvoiceDate, InvoiceDate. If you create another index with InvoiceDate first
you should attain comparable performance. You should probable do some
research so that you better understand these and other basic principles of
SQL-based systems.
Mike Rose
John Francis Lundy wrote in message <36e01880.0_at_news.proweb.co.uk>...
>Primary key - InvoiceNo
>Secondary key - InvoiceNo,InvoiceDate
>
>20,000 records
>
>select * from Invoice - 3 seconds
>
>select * from Invoice - 22 seconds
>order by InvoiceDate
>
>if the second query used the secondary index it should be faster as they'd
>be ordered already.
>Can I select the index? Whats my problem please help.
>
>
Received on Fri Mar 05 1999 - 12:41:09 CST