pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Teach bitmap path generation about transforming OR-clauses to SA
Date: Sun, 24 Nov 2024 00:00:22 +0000
Message-ID: <E1tF034-003F0T-T5@gemulon.postgresql.org> (raw)

Teach bitmap path generation about transforming OR-clauses to SAOP's

When optimizer generates bitmap paths, it considers breaking OR-clause
arguments one-by-one.  But now, a group of similar OR-clauses can be
transformed into SAOP during index matching.  So, bitmap paths should
keep up.

This commit teaches bitmap paths generation machinery to group similar
OR-clauses into dedicated RestrictInfos.  Those RestrictInfos are considered
both to match index as a whole (as SAOP), or to match as a set of individual
OR-clause argument one-by-one (the old way).

Therefore, bitmap path generation will takes advantage of OR-clauses to SAOP's
transformation.  The old way of handling them is also considered.  So, there
shouldn't be planning regression.

Discussion: https://postgr.es/m/CAPpHfdu5iQOjF93vGbjidsQkhHvY2NSm29duENYH_cbhC6x%2BMg%40mail.gmail.com
Author: Alexander Korotkov, Andrey Lepikhov
Reviewed-by: Alena Rybakina, Andrei Lepikhov, Jian he, Robert Haas
Reviewed-by: Peter Geoghegan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ae4569161a27823793ca24825bbabce2a91a0bc9

Modified Files
--------------
src/backend/optimizer/path/indxpath.c      | 430 ++++++++++++++++++++++++++++-
src/backend/optimizer/util/restrictinfo.c  | 107 ++++---
src/include/optimizer/restrictinfo.h       |  11 +
src/test/regress/expected/create_index.out | 125 ++++++++-
src/test/regress/expected/join.out         |  56 ++--
src/test/regress/sql/create_index.sql      |  38 +++
src/tools/pgindent/typedefs.list           |   1 +
7 files changed, 664 insertions(+), 104 deletions(-)



Message-ID: <E1tF034-003F0T-T5@gemulon.postgresql.org>
Permalink:  ../E1tF034-003F0T-T5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tF034-003F0T-T5@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: akorotkov@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Teach bitmap path generation about transforming OR-clauses to SA
  In-Reply-To: <E1tF034-003F0T-T5@gemulon.postgresql.org>

* 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