putting CHECK_FOR_INTERRUPTS in qsort_comparetup()

Поиск
Список
Период
Сортировка
От Charles Duffy
Тема putting CHECK_FOR_INTERRUPTS in qsort_comparetup()
Дата
Msg-id dfdaea8f0607110025p43c6b96ahfa95d02ed7ba3af5@mail.gmail.com
обсуждение исходный текст
Ответы Re: putting CHECK_FOR_INTERRUPTS in qsort_comparetup()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Hi,

We came up with this patch in response to a problem reported to us by a
client. They had a query which took an unacceptably long time to respond
to a cancel request (SIGINT). The client uses 8.1.4, so the patch is
against that.

Their work_mem setting was rather large (1000000). We determined that when it
received SIGINT, the backend was always inside qsort(), so it wouldn't
call ProcessInterrupts() again until it finished this large in-memory
sort. Upon entering tuplesort_performsort(), state->memtupcount was
29247.

The patch puts a CHECK_FOR_INTERRUPTS in qsort_comparetup. This solves
their problem, at the cost of checking InterruptPending a lot. The
"unlikely()" gcc directive might help there a bit.

I'm not sure if this patch has general applicability - but it seems to
solve the problem for our client. Does anyone think it might introduce
any new problems?

Thanks,


--
Charles Duffy

Вложения

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

Предыдущее
От: James Gates
Дата:
Сообщение: Patch to "configure" to enable PostgreSQL build with Kerberos 5 on Solaris 11
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Patch to "configure" to enable PostgreSQL build with Kerberos 5 on Solaris 11