Re: Use of additional index columns in rows filtering

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, James Coleman <jtc331(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Maxim Ivanov <hi(at)yamlcoder(dot)me>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, Konstantin Knizhnik <knizhnik(at)garret(dot)ru>, markus(dot)winand(at)winand(dot)at
Subject: Re: Use of additional index columns in rows filtering
Date: 2023-08-08 18:36:25
Message-ID: CAH2-WzmJwYmH0wmHBV5KYh+Eww22u2tL2rFUd+OPOwh9QTErTQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 8, 2023 at 11:14 AM Tomas Vondra
<tomas(dot)vondra(at)enterprisedb(dot)com> wrote:
> I agree this patch shouldn't make it harder to improve these cases, but
> TBH I don't quite see which part of the patch would do that? Which bit
> are you objecting to? If we decide to change how match_clause_to_index()
> deals with these cases, to recognize them as index quals, the patch will
> be working just fine.

Well, I also recently said that I think that it's important that you
figure out a way to reliably avoid visibility checks, in cases where
it can be avoided entirely -- since that can lead to huge savings in
heap accesses. You haven't done that yet, but you really should look
into it IMV.

Assuming that that happens, then it immediately gives index scans a
huge advantage over bitmap index scans. At that point it seems
important to describe (in high level terms) where it is that the
advantage is innate, and where it's just because we haven't done the
required work for bitmap index scans. I became confused on this point
myself yesterday. Admittedly I should have been able to figure it out
on my own -- but it is confusing.

> The only thing the patch does is it looks at clauses we decided not to
> treat as index quals, and do maybe still evaluate them on index. And I
> don't think I want to move these goalposts much further.

Avoiding the need for visibility checks completely (in at least a
subset of cases) was originally your idea. I'm not going to insist on
it, or anything like that. It just seems like something that'll add a
great deal of value over what you have already.

--
Peter Geoghegan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2023-08-08 19:15:53 Re: Use of additional index columns in rows filtering
Previous Message Tomas Vondra 2023-08-08 18:14:50 Re: Use of additional index columns in rows filtering