Re: [HACKERS] Re: about 7.0 LIMIT optimization

Поиск
Список
Период
Сортировка
От Don Baccus
Тема Re: [HACKERS] Re: about 7.0 LIMIT optimization
Дата
Msg-id 3.0.1.32.20000223173315.0170ba80@mail.pacifier.com
обсуждение исходный текст
Ответ на Re: about 7.0 LIMIT optimization  ("Roberto Cornacchia" <rob.c@virgilio.it>)
Ответы Re: [HACKERS] Re: about 7.0 LIMIT optimization  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
At 07:10 PM 2/23/00 -0500, Roberto Cornacchia wrote:

>Of course, if you have an index there is no problem. 
>It is even true that if you don't have an index there is no way to avoid
the sort, but in that case we use a specialized sort, which does much less
comparisons. 
>For example, if you want the 10 best rows from 100000, these are the
average numbers of comparisons:
>
>QuickSort: 1.6E+14
>SortStop: 1.5E+11

This makes sense ... you can stop once you can guarantee that the first
ten rows are in proper order.  I'm not familiar with the algorithm
but not terribly surprised that one exists.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] interesting observatation regarding views and V7.0
Следующее
От: Don Baccus
Дата:
Сообщение: Re: [HACKERS] interesting observatation regarding views and V7.0