Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 73F52632E89 for ; Mon, 14 Jun 2010 17:16:49 -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 13180-08 for ; Mon, 14 Jun 2010 20:16:41 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yx0-f174.google.com (mail-yx0-f174.google.com [209.85.213.174]) by mail.postgresql.org (Postfix) with ESMTP id 65C55632D37 for ; Mon, 14 Jun 2010 17:16:42 -0300 (ADT) Received: by yxl31 with SMTP id 31so1573722yxl.19 for ; Mon, 14 Jun 2010 13:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=tbXc45Uy1Mf82zZGO9mo3nH8s/vajKVyMeqbmwBcVgQ=; b=Dw5iJwjlY7kSCljTAHCTDs9KDfYS6Vbk89m+Ho9Z2Ca5q8+itCLPAuJR+udPPEqSvX FnJbrllUbLydu/fFsQbOzWJaxVSTSrp6eznE9VtdGfAX08/fpFstAoXL920qRJaK/6Ex 4up49Y5mFRJgK0vnkx8fjNIl3k9FCc8DxBL3k= 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; b=fRqohWLOWw8TUf6Wtv1VkpThTFeESJPONB5AKkcxGgpcMIyrpCiYnyczPAClJJ4mHq V9WqIUW611HGdvXOTWSaG65d07+IN8c3WpwFN3wFBwcL82modGD0PPogI3XiZRF+5CrG 3J4m0JjP701oV1DiejW3fwOqZR+4Oyq525jNU= MIME-Version: 1.0 Received: by 10.150.170.10 with SMTP id s10mr7655086ybe.269.1276546599473; Mon, 14 Jun 2010 13:16:39 -0700 (PDT) Received: by 10.151.13.3 with HTTP; Mon, 14 Jun 2010 13:16:39 -0700 (PDT) In-Reply-To: References: Date: Mon, 14 Jun 2010 14:16:39 -0600 Message-ID: Subject: Re: query hangs From: Scott Marlowe To: AI Rumman Cc: Szymon Guz , pgsql-performance@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.585 tagged_above=-10 required=5 tests=BAYES_00=-1.9, SARE_MILLIONSOF=0.315 X-Spam-Level: X-Archive-Number: 201006/251 X-Sequence-Number: 39107 On Thu, Jun 10, 2010 at 5:36 AM, AI Rumman wrote: > I found only AccessShareLock in pg_locks during the query. > And the query does not return data though I have been waiting for 10 mins. > > Do you have any idea ? I have queries that run for hours. As long as it's using CPU / IO (use top in unix, whatever in windows to see) it's not hung, it's just taking longer than you expected. Those are not the same thing at all. Seeing as how you're joining three tables with millions of rows with no where clause, it's gonna take some to complete. Go grab a sandwich, etc, come back when it's done.