Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1E4599FC42A for ; Tue, 5 Jun 2007 10:36:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 04664-01-9 for ; Tue, 5 Jun 2007 10:36:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from oxford.xeocode.com (unknown [62.232.55.118]) by postgresql.org (Postfix) with ESMTP id AF0D99FCA44 for ; Tue, 5 Jun 2007 10:32:38 -0300 (ADT) Received: from localhost ([127.0.0.1] helo=oxford.xeocode.com) by oxford.xeocode.com with esmtp (Exim 4.67) (envelope-from ) id 1HvZ9F-0005eH-JG; Tue, 05 Jun 2007 14:32:33 +0100 From: Gregory Stark To: "Gauri Kanekar" Cc: Subject: Re: Performance Problem In-Reply-To: <7e4ba9550706050253o5d7048c3vbe755eb7fc85d298@mail.gmail.com> (Gauri Kanekar's message of "Tue, 5 Jun 2007 15:23:35 +0530") Organization: EnterpriseDB References: <7e4ba9550706050226u7c2aa291he77dbfbeb90ce815@mail.gmail.com> <7e4ba9550706050253o5d7048c3vbe755eb7fc85d298@mail.gmail.com> X-Draft-From: ("nnimap+mail01.enterprisedb.com:INBOX.performance" 818) Date: Tue, 05 Jun 2007 14:32:33 +0100 Message-ID: <87lkeycyry.fsf@oxford.xeocode.com> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/64 X-Sequence-Number: 25097 "Gauri Kanekar" writes: > Befor doing vaccum full on the database this query use to take less > than 4min. But now after doing vacumming reindexing the tables it is > taking 73mins. Vacuum full is generally not necessary. You do need to ensure regular vacuum is run frequently on heavily updated tables though. > After observing the explain analyse it seems like it is not selecting > the required index properly. > > So can anybody suggest any thing?? -> Bitmap Index Scan on campaign_attributes_pk (cost=0.00..105.83 rows=60 width=0) (actual time=1.721..1.721 rows=1279 loops=1) When's the last time you analyzed your tables? Postgres is guessing it'll find 60 rows and instead finding over a thousands rows... -- Gregory Stark EnterpriseDB http://www.enterprisedb.com