pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Simplify bitmap updates in multivariate MCV code
2+ messages / 1 participants
[nested] [flat]

* pgsql: Simplify bitmap updates in multivariate MCV code
@ 2019-07-18 09:30  Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Vondra @ 2019-07-18 09:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7d24f6a49076f975ca87926b3cde8fdea3448ecb

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Simplify bitmap updates in multivariate MCV code
@ 2019-07-18 09:30  Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Vondra @ 2019-07-18 09:30 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-07-18 09:30 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-18 09:30 pgsql: Simplify bitmap updates in multivariate MCV code Tomas Vondra <tomas.vondra@postgresql.org>
2019-07-18 09:30 pgsql: Simplify bitmap updates in multivariate MCV code Tomas Vondra <tomas.vondra@postgresql.org>

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