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: Index design question

Re: Index design question

From: -=< a q u a b u b b l e >=- <aquabubble_at_Remove.No.Parma.Ham.Remove.geocities.com>
Date: Thu, 25 Nov 1999 14:04:42 -0000
Message-ID: <81k3r0$spu$2@news6.svr.pol.co.uk>


<michael_bialik_at_my-deja.com> wrote in message news:81f2a6$ida$1_at_nnrp1.deja.com...
> Hi.
>
> I have a claim system :
>
> CREATE TABLE claim (
> company_id NUMBER(4),
> claim_no NUMBER(12),
> open_date DATE,
> close_date DATE,
> description VARCHAR2(30),
> constraint claim_pk primary key ( company_id, claim_no));
>
> I need to write a query that performs :
>
> SELECT * FROM claim
> WHERE company_id = :p1 AND
> ( open_date between :p2 and :p3 OR
> close_date between :p2 AND :p3 );
>
> What do you think is the best index ( or indexes ) to support
> such query?

I'd have two indexes, one on company_id and open_date, and one on company_id and close_date.

HTH Received on Thu Nov 25 1999 - 08:04:42 CST

Original text of this message

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