| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Index design question
<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
![]() |
![]() |