Subject | Re: [IB-Architect] 'Order By' Issue |
---|---|
Author | Ann W. Harrison |
Post date | 2001-01-02T21:39:55Z |
At 02:38 PM 1/2/2001 +1030, Corey Wangler wrote:
the sort algorithm used. Besides, the major cost is
retrieval, not sorting.
finish than a sort. The first row comes faster, but
the total time is LONGER. Really and truly. Tested
and verified.
kicking out pages, re-reading them, kicking out others
that are needed again later, and so on.
many fit) so the client could unpack them at leisure
while the engine gets more. And it does.
single row is very significant. Reading all the
qualifying rows off a single page to sort later
saves enough random disk reads to totally bury the
cost of the sort.
Regards,
Ann
www.ibphoenix.com
we have answers
>TOP {n} would be handy to limit the amount of resourcesThat wouldn't work as well as you might think, given
>.... we could limit the resource usage by
>using TOP 10000, and even though it would go thru all
>records in the result set for ordering purposes, only those
>within the 10000 window would be kept in the sort file (other
>records would be discarded during the fetching).
the sort algorithm used. Besides, the major cost is
retrieval, not sorting.
>If ordering can be done *without* a temporary result set,Yes, and for large result sets it is often SLOWER to
>e.g. via index navigation, you would get results very
>quickly (minimal processing before returning a record).
>Can the database engine currently handle this?
finish than a sort. The first row comes faster, but
the total time is LONGER. Really and truly. Tested
and verified.
>couldn't the engine just go to the firstSure. Can and does.
>record that suits the criteria, and then return it?
>Subsequent fetch(s) would step through the index andReading in thousands of pages, overflowing the cache,
>stop at the next valid record and return it...
kicking out pages, re-reading them, kicking out others
that are needed again later, and so on.
>Even bettter, theAnd it might pack a buffer with the next n rows (however
>engine could keep one step ahead... returning a record
>and then finding the next straight away so as to
>minimize fetch response time.
many fit) so the client could unpack them at leisure
while the engine gets more. And it does.
>I'm not sure what the engine currently does in theseAnd they do. The cost of reading a page to get a
>areas, but such features could help to write speedy
>applications.
single row is very significant. Reading all the
qualifying rows off a single page to sort later
saves enough random disk reads to totally bury the
cost of the sort.
Regards,
Ann
www.ibphoenix.com
we have answers