Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id BF5459FB631 for ; Thu, 15 Feb 2007 12:05:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 45977-04 for ; Thu, 15 Feb 2007 12:05:26 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.239]) by postgresql.org (Postfix) with ESMTP id D5E969FB6D6 for ; Thu, 15 Feb 2007 12:05:25 -0400 (AST) Received: by wx-out-0506.google.com with SMTP id i28so721892wxd for ; Thu, 15 Feb 2007 08:05:25 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FcRE77rFdQHkMEhkI4EY27eqZ6nCovD2f44NrUq9TqComSYemqQWMd0k1rFITjXOr/GVJ9WCTXxMrQIdhEUpz2bQu7ct0FKvQORKxyFHI3ahz7TKfh5F2VHKBLpFAei8ZRQiDPIIB1UyePEQyt/5owTkCkqjMtTHGPBHVKxIGdU= Received: by 10.90.84.17 with SMTP id h17mr2587069agb.1171555525426; Thu, 15 Feb 2007 08:05:25 -0800 (PST) Received: by 10.90.113.7 with HTTP; Thu, 15 Feb 2007 08:05:25 -0800 (PST) Message-ID: <1d4e0c10702150805i73097134uf45ce1faa80e3763@mail.gmail.com> Date: Thu, 15 Feb 2007 17:05:25 +0100 From: "Guillaume Smet" To: "Tom Lane" Subject: Re: Question about Bitmap Heap Scan/BitmapAnd Cc: pgsql-performance@postgresql.org In-Reply-To: <1977.1171389065@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1d4e0c10702130832i35484abfmb229f5d0b4d9223b@mail.gmail.com> <1285.1171385353@sss.pgh.pa.us> <1d4e0c10702130917x5b6ddaf7g540bfe1f7c93b728@mail.gmail.com> <1977.1171389065@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200702/171 X-Sequence-Number: 23225 Tom, On 2/13/07, Tom Lane wrote: > It gets the right answer, yes. I'm not sure if we could safely put the > condition into the recheck instead of the filter. The particular code > I showed you has to go the direction it does, because a condition in the > filter has to be checked even if the bitmap is not lossy. I seem to > recall concluding that we had to recheck partial-index conditions even > if the bitmap is not lossy, but I can't reconstruct my reasoning at the > moment. I'm still working on my proximity query, testing PostGIS now. I noticed an issue with a gist index on a point which seems related to my previous question. I have the following in my plan: -> Bitmap Heap Scan on lieu l (cost=13.37..1555.69 rows=844 width=118) (actual time=3.672..39.497 rows=1509 loops=1) Filter: (((dfinvalidlieu IS NULL) OR (dfinvalidlieu >= now())) AND (wgslat IS NOT NULL) AND (wgslon IS NOT NULL) AND (wgslat <> 41.89103400) AND (wgslon <> 12.49244400) AND (earthpoint && '0103000020777F0000010000000500000000000040019B334100000020D1D8514100000040019B334100000040ADDE51410000006071B2334100000040ADDE51410000006071B2334100000020D1D8514100000040019B334100000020D1D85141'::geometry) AND (numlieu <> 49187)) -> Bitmap Index Scan on idx_lieu_earthpoint (cost=0.00..13.37 rows=1249 width=0) (actual time=2.844..2.844 rows=1510 loops=1) Index Cond: (earthpoint && '0103000020777F0000010000000500000000000040019B334100000020D1D8514100000040019B334100000040ADDE51410000006071B2334100000040ADDE51410000006071B2334100000020D1D8514100000040019B334100000020D1D85141'::geometry) Is it normal I have no recheck cond and the index cond of Bitmap Index Scan is in the filter? Is it also a consequence of the code you pointed? The index was created with: create index idx_lieu_earthpoint on lieu using gist(earthpoint gist_geometry_ops); -- Guillaume