Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to optimize this query?
vslabs_at_onwe.co.za (Billy Verreynne) wrote:
>
> This will be a bit slower, but should still be acceptable:
> SELECT
> count(*)
> FROM t
> WHERE surname BETWEEN 'SMITH' and 'SMYTHE'
> AND age BETWEEN 20 and 30
Out of curiousity, if there's an index based on (surname, age), might Oracle decide to combine a range scan on surname with a skip-scan on age for only things in the right surname range?
Xho
-- -------------------- http://NewsReader.Com/ -------------------- Usenet Newsgroup Service New Rate! $9.95/Month 50GBReceived on Mon Aug 11 2003 - 18:28:05 CDT