Re: Threaded Sorting

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Threaded Sorting
Дата
Msg-id 26334.1033762032@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Threaded Sorting  (Greg Copeland <greg@CopelandConsulting.Net>)
Ответы Re: Threaded Sorting  (Greg Copeland <greg@CopelandConsulting.Net>)
Список pgsql-hackers
Greg Copeland <greg@CopelandConsulting.Net> writes:
> ... I can understand why
> addressing the seemingly more common I/O bound case would receive
> priority, however, I'm at a loss as to why the other would be completely
> ignored.

Bruce already explained that we avoid threads because of portability and
robustness considerations.

The notion of a sort process pool seems possibly attractive.  I'm
unconvinced that it's going to be a win though because of the cost of
shoving data across address-space boundaries.  Another issue is that
the sort comparison function can be anything, including user-defined
code that does database accesses or other interesting stuff.  This
would mean that the sort auxiliary process would have to adopt the
database user identity of the originating process, and quite possibly
absorb a whole lot of other context information before it could
correctly/safely execute the comparison function.  That pushes the
overhead up a lot more.

(The need to allow arbitrary operations in the comparison function would
put a pretty substantial crimp on a thread-based approach, too, even if
we were willing to ignore the portability issue.)

Still, if you want to try it out, feel free ... this is an open-source
project, and if you can't convince other people that an idea is worth
implementing, that doesn't mean you can't implement it yourself and
prove 'em wrong.
        regards, tom lane


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

Предыдущее
От: "Curtis Faith"
Дата:
Сообщение: Re: Potential Large Performance Gain in WAL synching
Следующее
От: Greg Copeland
Дата:
Сообщение: Re: Threaded Sorting