pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Simplify bitmap updates in multivariate MCV code
Date: Thu, 18 Jul 2019 09:30:28 +0000
Message-ID: <E1ho2k8-0004Fe-DK@gemulon.postgresql.org> (raw)

Simplify bitmap updates in multivariate MCV code

When evaluating clauses on a multivariate MCV list, we build a bitmap
tracking how the clauses match each item of the MCV list.  When updating
the bitmap we need to consider the current value (tracking how the item
matches preceding clauses), match for the current clause and whether the
clauses are connected by AND or OR.

Until now the logic was copied on every place updating the bitmap, which
was not quite readable.  So just move it to a separate function and call
it where needed.

Backpatch to 12, where the code was introduced. While not a bugfix, this
should make maintenance and future backpatches easier.

Discussion: https://postgr.es/m/8736jdhbhc.fsf%40ansel.ydns.eu

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/79d3a1e52a3c1706cbabb00aec9175da7055319d

Modified Files
--------------
src/backend/statistics/mcv.c | 123 +++++++++++++++++--------------------------
1 file changed, 47 insertions(+), 76 deletions(-)



view thread (2+ messages)

Message-ID: <E1ho2k8-0004Fe-DK@gemulon.postgresql.org>
Permalink:  ../E1ho2k8-0004Fe-DK@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ho2k8-0004Fe-DK@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tomas.vondra@postgresql.org
  Subject: Re: pgsql: Simplify bitmap updates in multivariate MCV code
  In-Reply-To: <E1ho2k8-0004Fe-DK@gemulon.postgresql.org>
  References: <E1ho2k8-0004Fe-DK@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