Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 68E279FBE95 for ; Wed, 20 Jun 2007 19:06:32 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 81088-01-2 for ; Wed, 20 Jun 2007 19:06:27 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from exchange.g2switchworks.com (mail.g2switchworks.com [38.98.183.40]) by postgresql.org (Postfix) with ESMTP id 528AA9F9CBB for ; Wed, 20 Jun 2007 19:06:27 -0300 (ADT) Received: from [10.10.1.37] ([10.10.1.37]) by exchange.g2switchworks.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 20 Jun 2007 17:06:25 -0500 Message-ID: <4679A4E1.2060106@g2switchworks.com> Date: Wed, 20 Jun 2007 17:06:25 -0500 From: Scott Marlowe User-Agent: Thunderbird 1.5.0.4 (X11/20060516) MIME-Version: 1.0 To: Sergei Shelukhin CC: pgsql-performance@postgresql.org Subject: Re: any way to get rid of Bitmap Heap Scan recheck? References: <1179380547.753418.193030@w5g2000hsg.googlegroups.com> <1179570137.996544.101940@w5g2000hsg.googlegroups.com> In-Reply-To: <1179570137.996544.101940@w5g2000hsg.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Jun 2007 22:06:25.0603 (UTC) FILETIME=[3EA0C930:01C7B387] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.199 tagged_above=0 required=5 tests=AWL=0.198, BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200706/453 X-Sequence-Number: 25486 Sergei Shelukhin wrote: > Hi. > I have the following join condition in a query > "posttag inner join tag ON posttag.tagid = tag.id and tag.name = > 'blah'" > tag.id is PK, I have indexes on posttag.tagid and tag.name both > created with all the options set to default. > PG version is 8.1. > > > The query is very slow (3 minutes on test data), here's what takes all > the time, from explain results:Any ideas? Yes, post the output of explain analyze select ... (rest of query here) for starters