pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: mark@mark.mielke.cc
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Jie Zhang <jzhang@greenplum.com>
Cc: Hannu Krosing <hannu@skype.net>
Cc: Gavin Sherry <swm@linuxworld.com.au>
Cc: pgsql-hackers@postgresql.org, Luke Lonergan <LLonergan@greenplum.com>
Subject: Re: On-disk bitmap index patch
Date: Tue, 25 Jul 2006 00:36:42 -0400
Message-ID: <5085.1153802202@sss.pgh.pa.us> (raw)
In-Reply-To: <20060725015805.GA30087@mark.mielke.cc>
References: <C0EAB84F.8FB4%jzhang@greenplum.com>
	<200607250104.k6P14St25388@momjian.us>
	<20060725015805.GA30087@mark.mielke.cc>

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



view thread (52+ messages)  latest in thread

Message-ID: <5085.1153802202@sss.pgh.pa.us>
Permalink:  ../5085.1153802202@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/5085.1153802202@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mark@mark.mielke.cc, bruce@momjian.us, jzhang@greenplum.com, hannu@skype.net, swm@linuxworld.com.au, LLonergan@greenplum.com
  Subject: Re: On-disk bitmap index patch
  In-Reply-To: <5085.1153802202@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox