On Wed, Sep 20, 2017 at 8:26 AM, Andrey Borodin <x4...@yandex-team.ru> wrote:
> Hi hackers! > > 23 мая 2017 г., в 14:53, Andrew Borodin <boro...@octonica.com> > написал(а): > > > > Here's a small patch that implements fetch function necessary for > > Index Only Scans that use cube data type. > > Tom Lane have just commited d3a4f89 (Allow no-op GiST support functions to > be omitted) Thanks, Tom! : ) > "Index Only Scan support for cube" patch now is obsolete. I'm working on > another similar patch for contribs to support GiST IOS and remove no-op > support functions. > Good. BTW, some strangeness of g_cube_decompress() catch my eye. It compares results of two evaluations of same expression DatumGetNDBOXP(entry->key). NDBOX *key = DatumGetNDBOXP(entry->key); > if (key != DatumGetNDBOXP(entry->key)) In fact it's correct, because it compares results of two detoasting. If datum isn't toasted then results would be the same. And if data is toasted then results would be two different allocation of detoasted datum. However, we do extra detoasting here. For example, see gbt_var_decompress(). There is no extra detoasting here. GBT_VARKEY *key = (GBT_VARKEY *) PG_DETOAST_DATUM(entry->key); > if (key != (GBT_VARKEY *) DatumGetPointer(entry->key)) ------ Alexander Korotkov Postgres Professional: http://www.postgrespro.com The Russian Postgres Company