]> granicus.if.org Git - postgresql/commitdiff
Remove vestigial secondary-split support in gist_box_picksplit().
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Feb 2013 17:40:16 +0000 (12:40 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 10 Feb 2013 17:40:16 +0000 (12:40 -0500)
Not only is this implementation of secondary-split not better than the
default implementation in gistsplit.c, it's actually worse.  The gistsplit.c
code at least looks to see if switching the left and right sides would make
a better merge with the previously-split tuples, while this doesn't.

In any case it's rather useless to support secondary split only in an edge
case.  There used to be more complete support for it here (in chooseLR()),
but that was removed in commit 7f3bd86843e5aad84585a57d3f6b80db3c609916.
It appears to me though that the chooseLR() code was really isomorphic to
the default implementation, since it was still based on choosing the cheaper
way of adding two sub-split vectors that had been chosen without regard to
the primary split initially.  I think an implementation of secondary split
that could beat the default implementation would have to be pretty fully
integrated into the split algorithm, not plastered on at the end.

Back-patch to 9.2, but not further; previous branches have the chooseLR()
code which I don't feel a great need to mess with.  This is mainly so we
just have two behaviors and not three among the various branches (IOW, this
patch is cleanup for commit 7f3bd86843e5aad84585a57d3f6b80db3c609916's
incomplete removal of secondary-split support).

src/backend/access/gist/gistproc.c

index 6cb679736be7ccb81ffdd296518bdc169ef07aed..9c39f582266caff0a43a057bd58dac711b129832 100644 (file)
@@ -223,15 +223,8 @@ fallbackSplit(GistEntryVector *entryvec, GIST_SPLITVEC *v)
                }
        }
 
-       if (v->spl_ldatum_exists)
-               adjustBox(unionL, DatumGetBoxP(v->spl_ldatum));
        v->spl_ldatum = BoxPGetDatum(unionL);
-
-       if (v->spl_rdatum_exists)
-               adjustBox(unionR, DatumGetBoxP(v->spl_rdatum));
        v->spl_rdatum = BoxPGetDatum(unionR);
-
-       v->spl_ldatum_exists = v->spl_rdatum_exists = false;
 }
 
 /*