Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 1CDB2642C35 for ; Wed, 13 Jan 2010 14:11:48 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 06902-09 for ; Wed, 13 Jan 2010 18:11:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ew0-f213.google.com (mail-ew0-f213.google.com [209.85.219.213]) by mail.postgresql.org (Postfix) with ESMTP id 557DF633581 for ; Wed, 13 Jan 2010 14:11:37 -0400 (AST) Received: by ewy5 with SMTP id 5so13820918ewy.34 for ; Wed, 13 Jan 2010 10:11:35 -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=aDmXUul+KD9kP8zoaRG8JmY7DMIU7MFcuWguNBjSy7s=; b=pfWMTEzrS4WtOZQifVkNoJ32ppQK9iHW5zeCZh6rRYGyMZzUz5aXFHB3LoO/qT2XxJ KdYCBWU7zgyO7nibLbLcsk9lUJjzqbSW2Wpup/RAYBKS1QWlSEoC4vionsPRU11wLdsG jMy0A6yihIB6CN/pb6N5JDQ3d87ZGDwvwkxbc= 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=gKRCHGPu0Km2q+GhGNwq5x77bdUsx/2pKuvdFbgXUv+YcwEAyKhS8tr2BkvXqsQAQ3 pN6qF/IF8vn28cwD1yQOZjvnPLjhvdbZjdE1OQUx4AaRjS2DQRg0qrGXriGAoVTOpHW0 HJbi7qE3KHT5FZ6TqCw6y22vzVExJLQS37muo= MIME-Version: 1.0 Received: by 10.216.86.9 with SMTP id v9mr3282112wee.148.1263406292680; Wed, 13 Jan 2010 10:11:32 -0800 (PST) In-Reply-To: References: Date: Wed, 13 Jan 2010 11:11:32 -0700 Message-ID: Subject: Re: a heavy duty operation on an "unused" table kills my server From: Scott Marlowe To: Eduardo Piombino Cc: pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.589 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/260 X-Sequence-Number: 37140 On Wed, Jan 13, 2010 at 10:54 AM, Eduardo Piombino wrot= e: > >> OK, I'm not entirely sure this table is not still locking something >> else. =A0If you make a copy by doing something like: >> >> select * into test_table from a; >> >> and then alter test_table do you still get the same problems? =A0If so, >> then it is an IO issue, most likely. =A0If not, then there is some >> client connection still referencing this table or something and that >> could cause this type of behaviour as well. > > I can guarantee you that the table is not being referenced by any other > thread, table or process, and that it is totally unrelated to everything > else in the system. If you rename a table that WAS being referenced by other threads, then it might still be being accessed or waited on etc by those threads, as their transaction would have started earlier. The only way you can guarantee it's not being reference in some way is to create it fresh and new as I suggested and test on that. Until then, your guarantee is based on a belief, not verifiable fact. I too tend to believe this is an IO problem btw, but claiming that it can't be a problem with some locks without looking at pg_locks at least, is a bit premature.