simple sql using between startnumber and endnumber not performing
- From: Benjamin Sølberg <benjamin.soelberg@xxxxxxxxx>
- Date: Tue, 26 Jun 2007 18:02:48 -0700
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
.
- Follow-Ups:
- Re: simple sql using between startnumber and endnumber not performing
- From: Frank van Bortel
- Re: simple sql using between startnumber and endnumber not performing
- From: Malcolm Dew-Jones
- Re: simple sql using between startnumber and endnumber not performing
- Prev by Date: Re: RSA decryption in Oracle 9i
- Next by Date: Re: oracle 10g cryptography problem
- Previous by thread: Help with SQL - Update between tables
- Next by thread: Re: simple sql using between startnumber and endnumber not performing
- Index(es):
Relevant Pages
|