pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Justin Pryzby <pryzby@telsasoft.com>
Cc: Anastasia Lubennikova <a.lubennikova@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: bitmaps and correlation
Date: Fri, 27 Nov 2020 15:48:58 -0500
Message-ID: <724657.1606510138@sss.pgh.pa.us> (raw)
In-Reply-To: <f6afd7af-4ee2-923f-ba16-2bd2810f3cbe@iki.fi>
References: <20190101225615.GF25379@telsasoft.com>
	<20200313140916.GP29065@telsasoft.com>
	<160467068611.7362.8226463259534237605.pgcf@coridan.postgresql.org>
	<20201106175733.GB9839@telsasoft.com>
	<f6afd7af-4ee2-923f-ba16-2bd2810f3cbe@iki.fi>

Heikki Linnakangas <hlinnaka@iki.fi> writes:
> Other than that, and a quick pgdindent run, this seems ready to me. I'll 
> mark it as Ready for Committer.

I dunno, this seems largely misguided to me.

It's already the case that index correlation is just not the right
stat for this purpose, since it doesn't give you much of a toehold
on whether a particular scan is going to be accessing tightly-clumped
data.  For specific kinds of index conditions, such as a range query
on a btree index, maybe you could draw that conclusion ... but this
patch isn't paying any attention to the index condition in use.

And then the rules for bitmap AND and OR correlations, if not just
plucked out of the air, still seem *far* too optimistic.  As an
example, even if my individual indexes are perfectly correlated and
so a probe would touch only one page, OR'ing ten such probes together
is likely going to touch ten different pages.  But unless I'm
misreading the patch, it's going to report back an OR correlation
that corresponds to touching one page.

Even if we assume that the correlation is nonetheless predictive of
how big a part of the table we'll be examining, I don't see a lot
of basis for deciding that the equations the patch adds to
cost_bitmap_heap_scan are the right ones.

I'd have expected this thread to focus a whole lot more on actual
examples than it has done, so that we could have some confidence
that these equations have something to do with reality.

			regards, tom lane





view thread (16+ messages)  latest in thread

Message-ID: <724657.1606510138@sss.pgh.pa.us>
Permalink:  ../724657.1606510138@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/724657.1606510138@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, hlinnaka@iki.fi, pryzby@telsasoft.com, a.lubennikova@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: bitmaps and correlation
  In-Reply-To: <724657.1606510138@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