Re: BRIN page type identifier - Mailing list pgsql-hackers

From Tom Lane
Subject Re: BRIN page type identifier
Date
Msg-id 14066.1425958751@sss.pgh.pa.us
Whole thread Raw
In response to Re: BRIN page type identifier  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BRIN page type identifier  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: BRIN page type identifier
Next
From: Amit Kapila
Date:
Subject: Re: TABLESAMPLE patch