SP-GiST bug.

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: SP-GiST bug.
Date: 2014-05-20 23:13:45
Message-ID: 537BE1A9.1050006@sigaev.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

create table xxx ( t text);

insert into xxx select 'x' || v::text from generate_series(1, 291) as v;
insert into xxx values ('');

create index xxxidx on xxx using spgist (t);

And postgres will eat memory forever. It seems to me that checkAllTheSame
wrongly decides that all tuples are the same. All tuples except tuple to be
inserted have the same character 'x' and only new tuple has '\0'. But
checkAllTheSame() removes new tuple because set of tuples is too big to fit page
and founds that all tuples are the same. Patch attached, suppose, all branches
with spgist should be fixed.

Original data is too big to send in e-mail list or even send link, and the bug
caused not in root page as in example above.

--
Teodor Sigaev E-mail: teodor(at)sigaev(dot)ru
WWW: http://www.sigaev.ru/

Attachment Content-Type Size
spgist_allthesame.patch.gz application/x-tar 763 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-05-21 01:22:21 Re: jsonb failed assertions
Previous Message Tom Lane 2014-05-20 22:42:04 Re: jsonb inequality operators