Re: SP-GiST support for inet datatypes - Mailing list pgsql-hackers

From Emre Hasegeli
Subject Re: SP-GiST support for inet datatypes
Date
Msg-id CAE2gYzz4ijLDW51LQZycxc3s_jryEWVx5YLg2Jqfqxvt3euFcA@mail.gmail.com
Whole thread Raw
In response to Re: SP-GiST support for inet datatypes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: SP-GiST support for inet datatypes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> ... this part of the patch breaks the existing API for SP-GiST opclasses.
> That is a hard sell.  It may only matter for one existing opclass in core,
> but unless we have reason to think nobody is using any custom SP-GiST
> opclasses, that is not a pleasant thing to do.  How important is it really
> for this opclass?  Several of the existing opclasses use fixed numbers of
> child nodes, so why does this need something they don't?

This addition is required to implement the operator class cleanly.  We
could store the id of the child node as a "label", and add nodes when
labels are missing, but this complicates all operator class functions.
Other designs are also possible using the labels, but a simple design
with fixed number of nodes worked best for me.

Currently, SP-GiST framework supports fixed number of child nodes, if
the index is growing by page splits, not by prefix splits.  This is
not a fair API.  I assume it is designed by only having the prefix
tree in mind.  The change makes SP-GiST more reusable.

SP-GiST is not widely adopted in my experience.  Breaking this part of
the API would affect prefix tree implementations.  I don't think there
are much of them.  Supporting the new interface is easy for them.  We
can try to support the old interface by side of the new one, but this
wouldn't be very clean either.

I thought we were breaking the C interface in similar ways on major releases.



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: dsm_unpin_segment
Next
From: Thomas Munro
Date:
Subject: Re: synchronous_commit = remote_flush