GIST_LEAF vs. leaf_key; gist?entryinit

Started by Itai Zukermanalmost 23 years ago3 messages
#1Itai Zukerman
zukerman@math-hat.com

In the examples I've seen, in the consistent method we have:

if (GIST_LEAF(entry)) [...]

but in compress we have:

if (entry->leafkey) [...]

I can see what the latter's doing, but I'm not sure what GIST_LEAF
does, or why you'd want to use it.

Also, I noticed this in src/backend/access/gist:

static void gistcentryinit(GISTSTATE *giststate, int nkey,
GISTENTRY *e, Datum k,
Relation r, Page pg,
OffsetNumber o, int b, bool l, bool isNull);

and later (in gistPageAddItem):

gistcentryinit(giststate, 0, &tmpcentry, dentry->key, r, page,
offsetNumber, dentry->bytes, FALSE);

Isn't the call missing the "isNull" parameter?

--
Itai Zukerman <http://www.math-hat.com/~zukerman/&gt;

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Itai Zukerman (#1)
Re: GIST_LEAF vs. leaf_key; gist?entryinit

Itai Zukerman <zukerman@math-hat.com> writes:

and later (in gistPageAddItem):
gistcentryinit(giststate, 0, &tmpcentry, dentry->key, r, page,
offsetNumber, dentry->bytes, FALSE);
Isn't the call missing the "isNull" parameter?

I was just wondering whether GIST_PAGEADDITEM is defined or not.
Evidently not, because that code wouldn't get past gcc.

Anyone know when that #define symbol was introduced? Has the
GIST_PAGEADDITEM code *ever* worked?

regards, tom lane

#3Teodor Sigaev
teodor@stack.net
In reply to: Itai Zukerman (#1)
Re: GIST_LEAF vs. leaf_key; gist?entryinit

gistPageAddItem doesn't used. Look at mail archive, it was a discussion about
keep thes or not. Shortly: gistPageAddItem suppose to recompress entry, but we
can't
find any reason to do it. One more - gistPageAddItem works only with
single-key indexes.

Itai Zukerman wrote:

In the examples I've seen, in the consistent method we have:

if (GIST_LEAF(entry)) [...]

but in compress we have:

if (entry->leafkey) [...]

I can see what the latter's doing, but I'm not sure what GIST_LEAF
does, or why you'd want to use it.

Also, I noticed this in src/backend/access/gist:

static void gistcentryinit(GISTSTATE *giststate, int nkey,
GISTENTRY *e, Datum k,
Relation r, Page pg,
OffsetNumber o, int b, bool l, bool isNull);

and later (in gistPageAddItem):

gistcentryinit(giststate, 0, &tmpcentry, dentry->key, r, page,
offsetNumber, dentry->bytes, FALSE);

Isn't the call missing the "isNull" parameter?

--
Teodor Sigaev
teodor@stack.net