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: Optimize allocations in bringetbitmap
Date: Mon, 22 Mar 2021 23:55:22 +0000
Message-ID: <E1lOUOI-0007wM-5V@gemulon.postgresql.org> (raw)

Optimize allocations in bringetbitmap

The bringetbitmap function allocates memory for various purposes, which
may be quite expensive, depending on the number of scan keys. Instead of
allocating them separately, allocate one bit chunk of memory an carve it
into smaller pieces as needed - all the pieces have the same lifespan,
and it saves quite a bit of CPU and memory overhead.

Author: Tomas Vondra <tomas.vondra@postgresql.org>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Mark Dilger <hornschnorter@gmail.com>
Reviewed-by: Alexander Korotkov <aekorotkov@gmail.com>
Reviewed-by: Masahiko Sawada <masahiko.sawada@enterprisedb.com>
Reviewed-by: John Naylor <john.naylor@enterprisedb.com>
Discussion: https://postgr.es/m/c1138ead-7668-f0e1-0638-c3be3237e812@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8e4b332e88b8339408a3aa8c62bc93d96b67c808

Modified Files
--------------
src/backend/access/brin/brin.c | 60 +++++++++++++++++++++++++++++++++---------
1 file changed, 47 insertions(+), 13 deletions(-)



Message-ID: <E1lOUOI-0007wM-5V@gemulon.postgresql.org>
Permalink:  ../E1lOUOI-0007wM-5V@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lOUOI-0007wM-5V@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: Optimize allocations in bringetbitmap
  In-Reply-To: <E1lOUOI-0007wM-5V@gemulon.postgresql.org>
  References: <E1lOUOI-0007wM-5V@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