Re: A strange GiST error message or fillfactor of GiST build

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: x4mmm(at)yandex-team(dot)ru
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: A strange GiST error message or fillfactor of GiST build
Date: 2018-08-30 05:42:09
Message-ID: 20180830.144209.208080135.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

At Wed, 29 Aug 2018 10:42:59 -0300, Andrey Borodin <x4mmm(at)yandex-team(dot)ru> wrote in <6FBE12B2-4F59-4DB9-BDE9-62C8801189A8(at)yandex-team(dot)ru>
> >> postgres=# create table y as select cube(array(SELECT random() as a FROM generate_series(1,1000))) from generate_series(1,1e3,1);
> >> SELECT 1000
> >> postgres=# create index on y using gist(cube );
> >> ERROR: index row size 8016 exceeds maximum 8152 for index "y_cube_idx"
> >
> > This is apparently strange. This is because the message doesn't
> > count fill factor at the time. It is fixed by passing freespace
> > to gistSplit() and that allows gistfitpage() to consider
> > fillfactor as TODO comment within.
> >
> > After the attached patch applied, the above messages becomes as
> > follows. (And index can be built being a bit sparse by fill
> > factor.)
>
> We are passing freespace everywhere. Also, we pass GistInsertState, and GistState.
> Maybe let's put GistState into GistInsertState, GistState already has free space, and pass just GistInsertState everywhere?

Yeah, I thought something like that first. GISTSTATE doesn't have
freespace size but we could refactor so that all insert-related
routines use GISTInsertState and make GISTBuildState have
it. (patch 1) But this prevents future back-patching so I don't
think this acceptable.

The second patch corresponds to the original patch, which is not
srinked so much.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Refactor-parameter-of-GiST-insertion-routines.patch text/x-patch 46.9 KB
0002-Fix-error-message-of-gistSplit.patch text/x-patch 3.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2018-08-30 06:01:24 Re: pg_verify_checksums failure with hash indexes
Previous Message Andres Freund 2018-08-30 04:57:36 Re: Use C99 designated initializers for some structs