Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Can I define an index for a select statement.

Re: Can I define an index for a select statement.

From: Mike Rose <mmrose_at_home.com>
Date: Fri, 05 Mar 1999 18:41:09 GMT
Message-ID: <9zVD2.319$573.271@news.rdc1.md.home.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US