Re: GiST opclass and varlena

From: Dimitri Fontaine <dfontaine(at)hi-media(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: GiST opclass and varlena
Date: 2008-04-02 10:33:56
Message-ID: 200804021233.59487.dfontaine@hi-media.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Le mardi 25 mars 2008, Dimitri Fontaine a écrit :
> postgres=# create index idx_prefix on ranges using gist(prefix
> gist_prefix_range_ops);
> NOTICE: gpr_picksplit(): entryvec->n= 234 maxoff= 232 l= 176 r= 56 l+r=
> 232 unionL='01[0-7]' unionR='01[4-7]'
> NOTICE: gpr_picksplit(): v->spl_ldatum='01[0-7]' v->spl_rdatum='01[4-7]'
> ERROR: invalid memory alloc request size 3049878020

My previous tests were only done with REL8_2_STABLE cvs branch, I just redone
some tests with REL8_3_STABLE and got no error. The index is still buggy, in
the sense some requests returns different results with or without it
(enable_seqscan).

I've received some help on testing it too, and it seems the behavior is also
dependent on the architecture used. I'm using 32 bits linux arch, tests in 64
bit arch showed no error.

> The code is available at pgfoundry here:
> http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/prefix/prefix/

It still is :)
The easy way to test it is:

create table prefixes (
prefix text primary key,
name text not null,
shortname text,
state char default 'S',

check( state in ('S', 'R') )
);
comment on column prefixes.state is 'S: - R: reserved';

\copy prefixes from 'prefixes.fr.csv' with delimiter ; csv quote '"'

create table ranges as
select prefix::prefix_range, name, shortname, state from prefixes ;

create index idx_prefix on ranges using gist(prefix gist_prefix_range_ops);

Then enable_seqscan to on or off, and queries such as
select * from ranges where prefix @> '0100101234';
select * from ranges where prefix @> '0146640123';

On my 8.3 testing, the former query gives the same result with or without
using the GiST index, the latter doesn't.

Regards,
--
dim

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zdenek Kotala 2008-04-02 12:44:08 Re: Can Postgres 8.x start if some disks containing tablespaces are not mounted?
Previous Message Guillaume Smet 2008-04-02 09:36:18 Re: New boxes available for QA