Re: Kill a session - Mailing list pgsql-performance

From Craig A. James
Subject Re: Kill a session
Date
Msg-id 44B7B592.1090405@modgraph-usa.com
Whole thread Raw
In response to Re: Kill a session  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Kill a session  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
Tom Lane wrote:
> "Craig A. James" <cjames@modgraph-usa.com> writes:
>> Bottom line is that I was expecting "instant death" with SIGTERM, but
>> instead got an agonizing, drawn out -- but safe -- death of the query.
>
> What was the query exactly?
>
> Our expectation is that all or at least most queries should respond to
> SIGINT or SIGTERM interrupts pretty rapidly, say on a less-than-a-second
> timescale.  However there are various loops in the backend that fail to
> execute CHECK_FOR_INTERRUPTS sufficiently often :-(.  We've been
> gradually finding and fixing these, and will be glad to fix your case
> if you provide enough details to pin it down.  You might be interested
> in this current thread about a similar problem:
>
> http://archives.postgresql.org/pgsql-patches/2006-07/msg00039.php

Thanks, this is good information.  The qsort is a distinct possibility.  The query is a big

   insert into some_hitlist (select id from another_hitlist join data_table on (...))

where the hitlists are unindexed.  So it may be using a merge-join with qsort.  When I have a few minutes, I'll turn on
loggingin the app and find the exact SQL, and run an EXPLAIN ANALYZE and see what's really happening. 

It's also possible that the INSERT itself is the problem, or adds to the problem.  The SIGINT may come after a few
millionrows have been inserted, so it would have to clean that up, right? 

Thanks,
Craig


pgsql-performance by date:

Previous
From: Markus Schaber
Date:
Subject: Re: Kill a session
Next
From: Tom Lane
Date:
Subject: Re: Kill a session