Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id B38D3133655C for ; Sat, 9 Apr 2011 07:36:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 86087-03 for ; Sat, 9 Apr 2011 10:35:58 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from elizabeth.gransy.com (elizabeth.gransy.com [89.187.132.199]) by mail.postgresql.org (Postfix) with ESMTP id E7E6A13364DE for ; Sat, 9 Apr 2011 07:35:55 -0300 (ADT) Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id D78C215E434D; Sat, 9 Apr 2011 12:35:54 +0200 (CEST) Received: from 46.135.160.252 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Sat, 9 Apr 2011 12:35:54 +0200 Message-ID: <50d8f2eb94b393c11221c9d5232d7326.squirrel@sq.gransy.com> In-Reply-To: <945629628BB0174D86709AFE6D1CDEF5017A66C1@SP-EXCHMBC.sp.corp.collab.net> References: <945629628BB0174D86709AFE6D1CDEF5017A66C1@SP-EXCHMBC.sp.corp.collab.net> Date: Sat, 9 Apr 2011 12:35:54 +0200 Subject: Re: Slow query postgres 8.3 From: tv@fuzzy.cz To: "Anne Rosset" Cc: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal 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: 201104/92 X-Sequence-Number: 43154 > Hi, > > I am trying to tune a query that is taking too much time on a large > dataset (postgres 8.3). > Hi, run ANALYZE on the tables used in the query - the stats are very off, so the db chooses a really bad execution plan. Tomas