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

Home -> Community -> Usenet -> c.d.o.misc -> simple sql using between startnumber and endnumber not performing

simple sql using between startnumber and endnumber not performing

From: Benjamin Sølberg <benjamin.soelberg_at_gmail.com>
Date: Tue, 26 Jun 2007 18:02:48 -0700
Message-ID: <1182906168.409635.23940@n2g2000hse.googlegroups.com>


Hi all

I have a simple sql which I can't make perform.

In its simplest form it has two cols, a startnumber and an endnumber. None of the rows overlap with another.

I am using an sql which looks like this:

select startnumber, endnumber from table where '12345678' between startnumber and endnumber

I have also tried
select startnumber, endnumber from table where '12345678' >= startnumber and '12345678' <= endnumber

The latter sometimes performes a little better.

The table has about 6 mill rows.
I have tried with indexes on both rows, both with desc and asc as FBI in any combination that i can think of and also hinted the sql.

The explain plan shows that it will use the index but the query takes around 6 to 9 seconds which is way to much in respect of the needs.

Does any one of you have any suggestions ?

Regards
Benjamin Received on Tue Jun 26 2007 - 20:02:48 CDT

Original text of this message

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