gist access methods parameter types

From: Marios Vodas <mvodas(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: gist access methods parameter types
Date: 2010-09-27 08:26:59
Message-ID: AANLkTikj3ALyoHSzTXddw95hJ0w33U1xAvSr7pfBuc4R@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

If I have this sql composite type:

CREATE TYPE d_type AS
(

i integer,

e integer,

id integer

);

and this table:

CREATE TABLE my_tab
(
d_col d_type NOT NULL
)

CREATE INDEX my_tab_d_col_gist ON my_tab USING gist (d_col);

I am implementing consistent, union, compress, decompress, penalty,
picksplit and same.
CREATE OPERATOR CLASS d_type_ops
DEFAULT FOR TYPE d_type USING gist AS
FUNCTION 1 d_type_consistent(internal, d_type, smallint, oid, internal),
FUNCTION 2 d_type_union(internal, internal),
FUNCTION 3 d_type_compress(internal),
FUNCTION 4 d_type_decompress(internal),
FUNCTION 5 d_type_penalty(internal, internal, internal),
FUNCTION 6 d_type_picksplit(internal, internal),
FUNCTION 7 d_type_same(internal, internal, internal);

The problem is that some of these methods take as input parameters the
d_type and some the struct type that I internally implemented in c (which
will be saved to the tree).
If I understand correctly consistent and compress are the only functions
that will have input parameter of d_type. The others will have my c internal
type.
*Is this correct?*
Something else, will a non-leaf node have one entry that will be produced by
union? I am asking because I want the leaf node entries to be of different
type from non-leaf node entries (the difference between them is that
non-leaf entry will not keep the id attribute).
Thank you in advance.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Devrim GÜNDÜZ 2010-09-27 08:58:04 A small update for postgresql.conf.sample
Previous Message Dimitri Fontaine 2010-09-27 08:06:20 Re: do we want to gitignore regression-test-failure files?