On Thu, Jul 28, 2016 at 11:09 AM, Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>
wrote:

1. What happens if you add an Order By to your SELECT statement with the
range?


​Still a full table scan​



2. What happens if you additionally create a derived index over the
relative record no?


​A full table scan w/o ORDER BY, Index probe with ORDER BY, returning in
61ms.


Interestingly, the "estimated number of rows" coming out of the table scan
is 745,428.​


​Which is then feed into an "AND" operation...with 745,429 rows coming out
of that into the final select.

I tried adding an OPTIMIZE FOR 11 ROWS, that didn't have an effect.

Also tried FETCH FIRST 11 ROWS ONLY..​that still shows the table scan with
745,428 rows, but it returns in 241ms instead of 27.4s

Charles

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.