pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix contrib/bloom to work for unlogged indexes.
Date: Wed, 25 May 2016 01:05:03 +0000
Message-ID: <E1b5NFv-0000zd-IY@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fix contrib/bloom to work for unlogged indexes.

blbuildempty did not do even approximately the right thing: it tried
to add a metapage to the relation's regular data fork, which already
has one at that point.  It should look like the ambuildempty methods
for all the standard index types, ie, initialize a metapage image in
some transient storage and then write it directly to the init fork.
To support that, refactor BloomInitMetapage into two functions.

In passing, fix BloomInitMetapage so it doesn't leave the rd_options
field of the index's relcache entry pointing at transient storage.
I'm not sure this had any visible consequence, since nothing much
else is likely to look at a bloom index's rd_options, but it's
certainly poor practice.

Per bug #14155 from Zhou Digoal.

Report: <20160524144146.22598.42558@wrigleys.postgresql.org>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/abaffa907588283f7673fc223857e6966421b8ca

Modified Files
--------------
contrib/bloom/blinsert.c         | 25 ++++++++++++----
contrib/bloom/bloom.h            |  1 +
contrib/bloom/blutils.c          | 63 +++++++++++++++++++++++++++-------------
contrib/bloom/expected/bloom.out | 58 ++++++++++++++++++++++++++++++++++++
contrib/bloom/sql/bloom.sql      | 22 ++++++++++++++
5 files changed, 144 insertions(+), 25 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1b5NFv-0000zd-IY@gemulon.postgresql.org>
Permalink:  ../E1b5NFv-0000zd-IY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1b5NFv-0000zd-IY@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix contrib/bloom to work for unlogged indexes.
  In-Reply-To: <E1b5NFv-0000zd-IY@gemulon.postgresql.org>
  References: <E1b5NFv-0000zd-IY@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