Re: [PATCH] Covering SPGiST index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: David Steele <david(at)pgmasters(dot)net>, "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>, Anastasia Lubennikova <a(dot)lubennikova(at)postgrespro(dot)ru>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Covering SPGiST index
Date: 2021-03-12 00:42:30
Message-ID: 2403515.1615509750@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I spent a little time looking at this, and realized something that may
> or may not be a serious problem. This form of the patch supposes that
> it can use the usual tuple form/deform logic for all columns of a leaf
> tuple including the key column. However, that does not square with
> SPGIST's existing storage convention for pass-by-value key types: we
> presently assume that those are stored in their Datum representation,
> ie always 4 or 8 bytes depending on machine word width, even when
> typlen is less than that.

> Now there is an argument why this might not be an unacceptable disk
> format breakage: there probably aren't any SPGIST indexes with a
> pass-by-value leaf key type.

On further contemplation, it occurs to me that if we make the switch
to "key values are stored per normal rules", then even if there is an
index with pass-by-value keys out there someplace, it would only break
on big-endian architectures. On little-endian, the extra space
occupied by the Datum format would just seem to be padding space.
So this probably means that the theoretical compatibility hazard is
small enough to be negligible, and we should go with my option #2
(i.e., we need to replace SGLTDATUM with normal attribute-fetch logic).

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-03-12 00:44:26 Re: compression libraries and CF bot
Previous Message Stephen Frost 2021-03-12 00:41:04 Re: automatic analyze: readahead - add "IO read time" log message