Re: Vacuum, Freeze and Analyze: the big picture

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: Vacuum, Freeze and Analyze: the big picture
Дата
Msg-id CAM3SWZQmHv3jHq-_nUuGUo3gmjfrBS3sRYRzR7e=ZkfMU=jwrA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Vacuum, Freeze and Analyze: the big picture  (Jim Nasby <jim@nasby.net>)
Список pgsql-hackers
On Tue, Jun 18, 2013 at 6:11 PM, Jim Nasby <jim@nasby.net> wrote:
> IIRC there's some kind of compression or something used with on-disk sorts.

I think you're mistaken.

> If that's correct then I think what's happening is that the "on-disk" sort that fits into cache
> is actually using less memory than quicksort. Or perhaps it was just a matter of memory
> locality within each tape. It's been too long since I looked at it. :(

External sorts do of course use less memory, but quicksort is
particularly good at taking advantage of memory locality.

I think it's possible that what you recall is the days when we used
the OS qsort(), and we were at the mercy of the implementation that
the OS provided. When we effectively began to vendor our own sort
routine in 2006, we chose a high-quality one with various protections
against quadratic behaviors. Implementations that lacked these
protections were prevalent at a surprisingly late stage.

-- 
Peter Geoghegan



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

Предыдущее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements
Следующее
От: Fabrízio de Royes Mello
Дата:
Сообщение: Re: Patch to add support of "IF NOT EXISTS" to others "CREATE" statements