Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 1B320B5DC24 for ; Thu, 27 Oct 2011 23:42:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 79901-04 for ; Fri, 28 Oct 2011 02:42:05 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from smtp.01.com (smtp.01.com [216.115.88.169]) by mail.postgresql.org (Postfix) with ESMTP id DB6C7B5DC20 for ; Thu, 27 Oct 2011 23:42:04 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id A18C39D0749 for ; Thu, 27 Oct 2011 21:42:02 -0500 (CDT) X-Virus-Scanned: amavisd-new at smtp-out-1.01.com Received: from smtp.01.com ([127.0.0.1]) by localhost (smtp-out-1.01.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E93Rvyaxw-MN for ; Thu, 27 Oct 2011 21:42:02 -0500 (CDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp-out-1.01.com (Postfix) with ESMTP id 7F0E79D0751 for ; Thu, 27 Oct 2011 21:42:02 -0500 (CDT) Received: from Sidney-Stratton.local (70-36-197-225.dsl.dynamic.sonic.net [70.36.197.225]) by smtp-out-1.01.com (Postfix) with ESMTPSA id 4A1C19D0749 for ; Thu, 27 Oct 2011 21:42:02 -0500 (CDT) Message-ID: <4EAA1679.6060201@agliodbs.com> Date: Thu, 27 Oct 2011 19:42:01 -0700 From: Josh Berkus Organization: PostgreSQL Experts Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Re: PostgreSQL 9.0.4 blocking in lseek? References: <4EA82B7C.1040008@google.com> In-Reply-To: <4EA82B7C.1040008@google.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201110/240 X-Sequence-Number: 45462 On 10/26/11 8:47 AM, Sören Meyer-Eppler wrote: > A fairly complex insert query on an empty destination table will run for > an indefinite amount of time (we waited literally days for the query to > complete). This does not happen every time we run the query but often. > Now ordinarily I'd assume we did something wrong with our indices or > query, but the execution plan looks sane and, more tellingly, we have: > - no CPU load > - no network traffic > - no disk I/O > - no other load on the server except this single query > and strace displaying a seemingly endless list of lseek calls. Hmmmm. If you were on Solaris or OSX, I'd say you'd hit one of their I/O bugs which can cause endless lseeks for individual disk pages. However, I've never seen that particular pattern on Linux (other I/O bugs, but not that one). Questions: (1) is it *only* that query? (2) is there some reason you might have excessive disk fragmentation, like running on a VM? -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com