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: How to search date ranges

Re: How to search date ranges

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Mon, 28 Jan 2002 06:44:51 +0100
Message-ID: <34p95usoqcp7uf7rm4h7fs1f846ij63hgf@4ax.com>


On Mon, 28 Jan 2002 03:37:35 GMT, "Michael Gill News" <me_at_work.com> wrote:

>If I understand you correctly, creating an index on (person_id, start_date)
>would be quite effective, eh?
>Would you explain what you mean by "leading table"? Are you referring to the
>order in the FROM clause?
>
>Many thanks

The order in the from clause is only relevant when the optimizer is incapable to determine the driving table. By design the driving table (the table being read first) is the table which will return the lowest number of records.
If the optimizer can't determine the driving table, it will use the tables in the from clause from left to right (cost based optimizer, which you are using) or from right to left (rule based optimizer). Using the cost based optimizer the order can be forced by using select /*+ ordered */ .....
from ....
etc.

Hth

Sybrand Bakker, Senior Oracle DBA

To reply remove -verwijderdit from my e-mail address Received on Sun Jan 27 2002 - 23:44:51 CST

Original text of this message

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