pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig A. James <cjames@modgraph-usa.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-performance@postgresql.org
Cc: sgunderson@bigfoot.com
Subject: Re: Kill a session
Date: Fri, 14 Jul 2006 08:17:38 -0700
Message-ID: <44B7B592.1090405@modgraph-usa.com> (raw)
In-Reply-To: <8780.1152856222@sss.pgh.pa.us>
References: <6BCB9D8A16AC4241919521715F4D8BCEA0FAE8@algol.sollentuna.se>
	<44B51896.1000808@modgraph-usa.com>
	<20060712170404.GA27392@uio.no>
	<44B70017.6000703@modgraph-usa.com>
	<8780.1152856222@sss.pgh.pa.us>

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 logging in 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 million rows have been inserted, so it would have to clean that up, right?

Thanks,
Craig




view thread (14+ messages)  latest in thread

Message-ID: <44B7B592.1090405@modgraph-usa.com>
Permalink:  ../44B7B592.1090405@modgraph-usa.com/
Also on:    postgresql.org/message-id/44B7B592.1090405@modgraph-usa.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: cjames@modgraph-usa.com, tgl@sss.pgh.pa.us, sgunderson@bigfoot.com
  Subject: Re: Kill a session
  In-Reply-To: <44B7B592.1090405@modgraph-usa.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox