Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

gist problem


  • From: Grzegorz Piotr Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
  • To: pgsql-hackers(at)postgresql(dot)org
  • Subject: gist problem
  • Date: Wed, 26 Oct 2005 20:02:29 +0200
  • Message-id: <200510262002(dot)29987(at)gj-laptop>

Hi list

I got memleak fixed, valgrind doesn't quite find problems there, I had to dig 
it manually. 

Anyway, to the point. 
Now that I've created gist index, I want to use it on table, here it goes:

CREATE OPERATOR CLASS gist_enum2916_operators
DEFAULT FOR TYPE enum2916 USING gist
AS
	OPERATOR	1	>>= ,
	OPERATOR	2	<<= ,
	OPERATOR	3	>> ,
	OPERATOR	4	<< ,
	OPERATOR	5	&& ,
	OPERATOR	6	= ,

	FUNCTION	1	enum_consistent (internal, enum2916, enum2916),
	FUNCTION	2	enum_union (internal, internal),
	FUNCTION	3	enum_compress (internal),
	FUNCTION	4	enum_decompress (internal),
	FUNCTION	5	enum_penalty (internal, internal, internal),
	FUNCTION	6	enum_picksplit (internal, internal),
	FUNCTION	7	enum_same (enum2916, enum2916, internal);

than I create table and apply index to it.
At this point enable_seqscan is off.

CREATE TABLE dupa (
    a integer,
    b enum2916
);

--- we can now create gist index, let's do it :P
CREATE INDEX blah ON dupa USING gist (b);


I am unable to use ~ or @ operators, I thought gist would supply them for me, 
am I right ?

even through seqscan is off, on 
explain analyze select * from dupa where b <> 'something';
I get:
                                            QUERY PLAN
----------------------------------------------------------------------------------------------------
 Seq Scan on dupa  (cost=0.00..24.50 rows=580 width=36) (actual 
time=2.344..29.432 rows=12 loops=1)
   Filter: (b <> '%.4.0.6.1.e164.digifonica.com'::enum2916)
 Total runtime: 29.936 ms
(3 rows)

Can someone shed a bit of light on this for me please.
This is postgres 8.1b4, basicaly cvs head.

Thanks.

-- 
GJ

Binary system, you're either 1 or 0...
dead or alive ;)



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group