pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add IntegerSet, to hold large sets of 64-bit ints efficiently.
Date: Fri, 22 Mar 2019 11:26:41 +0000
Message-ID: <E1h7IJt-000237-Ck@gemulon.postgresql.org> (raw)

Add IntegerSet, to hold large sets of 64-bit ints efficiently.

The set is implemented as a B-tree, with a compact representation at leaf
items, using Simple-8b algorithm, so that clusters of nearby values use
less memory.

The IntegerSet isn't used for anything yet, aside from the test code, but
we have two patches in the works that would benefit from this: A patch to
allow GiST vacuum to delete empty pages, and a patch to reduce heap
VACUUM's memory usage, by storing the list of dead TIDs more efficiently
and lifting the 1 GB limit on its size.

This includes a unit test module, in src/test/modules/test_integerset.
It can be used to verify correctness, as a regression test, but if you run
it manully, it can also print memory usage and execution time of some of
the tests.

Author: Heikki Linnakangas, Andrey Borodin
Reviewed-by: Julien Rouhaud
Discussion: https://www.postgresql.org/message-id/b5e82599-1966-5783-733c-1a947ddb729f@iki.fi

Branch
------
master

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

Modified Files
--------------
src/backend/lib/Makefile                           |    2 +-
src/backend/lib/README                             |    2 +
src/backend/lib/integerset.c                       | 1019 ++++++++++++++++++++
src/include/lib/integerset.h                       |   24 +
src/test/modules/Makefile                          |    1 +
src/test/modules/test_integerset/.gitignore        |    4 +
src/test/modules/test_integerset/Makefile          |   21 +
src/test/modules/test_integerset/README            |    7 +
.../test_integerset/expected/test_integerset.out   |   14 +
.../test_integerset/sql/test_integerset.sql        |   11 +
.../test_integerset/test_integerset--1.0.sql       |    8 +
src/test/modules/test_integerset/test_integerset.c |  622 ++++++++++++
.../test_integerset/test_integerset.control        |    4 +
13 files changed, 1738 insertions(+), 1 deletion(-)



Message-ID: <E1h7IJt-000237-Ck@gemulon.postgresql.org>
Permalink:  ../E1h7IJt-000237-Ck@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h7IJt-000237-Ck@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: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Add IntegerSet, to hold large sets of 64-bit ints efficiently.
  In-Reply-To: <E1h7IJt-000237-Ck@gemulon.postgresql.org>
  References: <E1h7IJt-000237-Ck@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