X-Original-To: pgsql-hackers-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 576EC9FA68D for ; Tue, 25 Jul 2006 01:37:18 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 60573-07 for ; Tue, 25 Jul 2006 04:37:12 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 2E7C49FA4E0 for ; Tue, 25 Jul 2006 01:37:11 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k6P4ag2q005086; Tue, 25 Jul 2006 00:36:42 -0400 (EDT) To: mark@mark.mielke.cc cc: Bruce Momjian , Jie Zhang , Hannu Krosing , Gavin Sherry , pgsql-hackers@postgresql.org, Luke Lonergan Subject: Re: On-disk bitmap index patch In-reply-to: <20060725015805.GA30087@mark.mielke.cc> References: <200607250104.k6P14St25388@momjian.us> <20060725015805.GA30087@mark.mielke.cc> Comments: In-reply-to mark@mark.mielke.cc message dated "Mon, 24 Jul 2006 21:58:05 -0400" Date: Tue, 25 Jul 2006 00:36:42 -0400 Message-ID: <5085.1153802202@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/1118 X-Sequence-Number: 86973 mark@mark.mielke.cc writes: > Reading 1/4, for a larger table, has a good chance of being faster than > reading 4/4 of the table. :-) Really? If you have to hit one tuple out of four, it's pretty much guaranteed that you will need to fetch every heap page. So using an index provides zero I/O savings on the heap side, and any fetches needed to read the index are pure cost. Now you have to demonstrate that the CPU costs involved in processing the index are significantly cheaper than the cost of just testing the WHERE qual at every heap tuple --- not a bet that's likely to win at a one-in-four ratio. > Will it be worth it or not? I won't know until I try it. :-) Agreed. regards, tom lane