Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 9089B633F7F for ; Sat, 28 Feb 2009 23:15:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 85195-09 for ; Sat, 28 Feb 2009 23:15:19 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-gx0-f176.google.com (mail-gx0-f176.google.com [209.85.217.176]) by mail.postgresql.org (Postfix) with ESMTP id E5E2E63375D for ; Sat, 28 Feb 2009 23:15:19 -0400 (AST) Received: by gxk24 with SMTP id 24so4470395gxk.19 for ; Sat, 28 Feb 2009 19:15:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3h+N542jvI5ETo5fbvoe6QPWeZmAiiF3abSZh9+f0C4=; b=bzpzIIse/wu+bFejgA9yXZvUGkcXaDW8L6UQyRPnZijQm58N+MxwwhI03bZVRhensf 368IBbzYVkP3JrLmkF3+NsUtz6vEUQVR4mgFKaqW5/6ekwqX12+xFkZzjeNuoVHs4yyn D70c6OM1S8VtYLWRnuWPsmpqNuHunWe7b7KUE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=mwBYRHX/D5QFnkfS7azKR5C45ASz1dqp6RX6fMoYyonvtOLCFI9JmFGXSYEanwvDwM jO2HKC4Lf4lXUWjkcXCAdO8y/KbPt7CHckFEBojgDEoY5YWZ/i0hSAOGpmwkCriLWYQU dsr+VOKD+vRUiDNmFfwPf4WHKObFz7e9pTQaE= MIME-Version: 1.0 Received: by 10.220.95.202 with SMTP id e10mr1366093vcn.12.1235877318019; Sat, 28 Feb 2009 19:15:18 -0800 (PST) In-Reply-To: <49A9F834.8060100@ca.com> References: <49A9F834.8060100@ca.com> Date: Sat, 28 Feb 2009 22:15:17 -0500 Message-ID: <603c8f070902281915u4d402589wef143ff433a8a3d2@mail.gmail.com> Subject: Re: "slow" queries From: Robert Haas To: Brian Cox Cc: "pgsql-performance@postgresql.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200902/340 X-Sequence-Number: 32921 On Sat, Feb 28, 2009 at 9:51 PM, Brian Cox wrote: > Actually, they're all deadlocked. The question is why? > > Here's a brief background. The ts_defects table is partitioned by occurrence > date; each partition contains the rows for 1 day. When the data gets old > enough, the partition is dropped. Since the correct partition can be > determined from the occurrence date, there is no trigger: inserts are done > directly into the correct partition. Multiple threads may be inserting into > a partition at the same time. The thread that checks for old data to be > dropped runs at 00:30 each night. It also creates the partition for the next > day. > > Below is the output from: > select xact_start,query_start,substring(current_query from 0 for 40) from > pg_stat_activity order by xact_start; Can you post this again with procpid added to the column list and without truncating current_query? And then also post the results of "select * from pg_locks"? Is there anything interesting in the postmaster log? ...Robert