Re: BRIN page type identifier

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BRIN page type identifier
Date: 2015-03-10 03:39:11
Message-ID: 14066.1425958751@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> You could try something like
> typedef struct BrinSpecialSpace
> {
> uint16 vector[MAXALIGN(1) / sizeof(uint16)];
> } BrinSpecialSpace;
> and then some access macros to use the last and next-to-last
> elements of that array.

On second thought, consider

typedef struct BrinSpecialSpace
{
uint16 flags;
uint16 vector[MAXALIGN(1) / sizeof(uint16) - 1];
} BrinSpecialSpace;

This way, accesses to "flags" require no source code changes.
You still need a macro to map "type" onto the last element of
the vector, but there's probably about one reference to "type"
in the source code so it shouldn't be too painful.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2015-03-10 03:43:58 Re: TABLESAMPLE patch
Previous Message Alvaro Herrera 2015-03-10 03:36:42 Re: BRIN page type identifier