Re: [PATCHES] putting CHECK_FOR_INTERRUPTS in qsort_comparetup()

From: Greg Stark <gsstark(at)mit(dot)edu>
To: "Charles Duffy" <charles(dot)duffy(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] putting CHECK_FOR_INTERRUPTS in qsort_comparetup()
Date: 2006-07-12 04:44:29
Message-ID: 87psgbl9ea.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


"Charles Duffy" <charles(dot)duffy(at)gmail(dot)com> writes:

> 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.

It occurs to me that this kind of thing is something dtrace could help with.
It might even be able to do something clever like "time between consecutive
CHECK_FOR_INTERRUPT calls grouped by the function that postgres spent the most
time in between those points". If not that then something like "grouped by the
first function call in the intervening period" is probably pretty
straightforward.

Of course this is complicated by CHECK_FOR_INTERRUPTS being a macro... perhaps
a probe could be added in that macro. In fact I suspect many of the locations
we'll need manually added probes will be macros.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ITAGAKI Takahiro 2006-07-12 04:57:15 Re: passing parameters to CREATE INDEX
Previous Message Joe Conway 2006-07-12 03:38:08 Re: row() is [not] null infelicities

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-07-12 04:54:42 Re: New regresion test for SET/RESET commnad
Previous Message Marc G. Fournier 2006-07-12 04:19:12 Re: reply to ...