Skip to content
Snippets Groups Projects
  1. Feb 10, 2013
    • Tom Lane's avatar
      Remove vestigial secondary-split support in gist_box_picksplit(). · dacc185f
      Tom Lane authored
      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 7f3bd868.
      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 7f3bd868's
      incomplete removal of secondary-split support).
      dacc185f
  2. Feb 09, 2013
    • Tom Lane's avatar
      Fix gist_box_same and gist_point_consistent to handle fuzziness correctly. · 3c29b196
      Tom Lane authored
      While there's considerable doubt that we want fuzzy behavior in the
      geometric operators at all (let alone as currently implemented), nobody is
      stepping forward to redesign that stuff.  In the meantime it behooves us
      to make sure that index searches agree with the behavior of the underlying
      operators.  This patch fixes two problems in this area.
      
      First, gist_box_same was using fuzzy equality, but it really needs to use
      exact equality to prevent not-quite-identical upper index keys from being
      treated as identical, which for example would prevent an existing upper
      key from being extended by an amount less than epsilon.  This would result
      in inconsistent indexes.  (The next release notes will need to recommend
      that users reindex GiST indexes on boxes, polygons, circles, and points,
      since all four opclasses use gist_box_same.)
      
      Second, gist_point_consistent used exact comparisons for upper-page
      comparisons in ~= searches, when it needs to use fuzzy comparisons to
      ensure it finds all matches; and it used fuzzy comparisons for point <@ box
      searches, when it needs to use exact comparisons because that's what the
      <@ operator (rather inconsistently) does.
      
      The added regression test cases illustrate all three misbehaviors.
      
      Back-patch to all active branches.  (8.4 did not have GiST point_ops,
      but it still seems prudent to apply the gist_box_same patch to it.)
      
      Alexander Korotkov, reviewed by Noah Misch
      3c29b196
  3. Jan 01, 2013
  4. Jun 10, 2012
  5. May 12, 2012
  6. Feb 28, 2012
  7. Jan 30, 2012
  8. Jan 02, 2012
  9. Oct 09, 2011
    • Heikki Linnakangas's avatar
      Clean up a couple of box gist helper functions. · d50e1251
      Heikki Linnakangas authored
      The original idea of this patch was to make box picksplit run faster, by
      eliminating unnecessary palloc() overhead, but that was obsoleted by the new
      double-sorting split algorithm that doesn't call these functions so heavily
      anymore. Nevertheless, the code looks better this way.
      
      Original patch by me, reviewed and tidied up after the double-sorting patch
      by Kevin Grittner.
      d50e1251
  10. Oct 06, 2011
  11. Apr 10, 2011
  12. Jan 01, 2011
  13. Dec 04, 2010
    • Tom Lane's avatar
      KNNGIST, otherwise known as order-by-operator support for GIST. · 55450687
      Tom Lane authored
      This commit represents a rather heavily editorialized version of
      Teodor's builtin_knngist_itself-0.8.2 and builtin_knngist_proc-0.8.1
      patches.  I redid the opclass API to add a separate Distance method
      instead of turning the Consistent method into an illogical mess,
      fixed some bit-rot in the rbtree interfaces, and generally worked over
      the code style and comments.
      
      There's still no non-code documentation to speak of, but I'll work on
      that separately.  Some contrib-module changes are also yet to come
      (right now, point <-> point is the only KNN-ified operator).
      
      Teodor Sigaev and Tom Lane
      55450687
  14. Nov 15, 2010
  15. Sep 20, 2010
  16. Feb 26, 2010
  17. Jan 14, 2010
  18. Jan 02, 2010
  19. Sep 18, 2009
  20. Jun 11, 2009
  21. Apr 06, 2009
  22. Jan 01, 2009
  23. Apr 14, 2008
    • Tom Lane's avatar
      Push index operator lossiness determination down to GIST/GIN opclass · 9b5c8d45
      Tom Lane authored
      "consistent" functions, and remove pg_amop.opreqcheck, as per recent
      discussion.  The main immediate benefit of this is that we no longer need
      8.3's ugly hack of requiring @@@ rather than @@ to test weight-using tsquery
      searches on GIN indexes.  In future it should be possible to optimize some
      other queries better than is done now, by detecting at runtime whether the
      index match is exact or not.
      
      Tom Lane, after an idea of Heikki's, and with some help from Teodor.
      9b5c8d45
  24. Jan 01, 2008
  25. Nov 15, 2007
  26. Sep 07, 2007
  27. Jan 05, 2007
  28. Oct 04, 2006
  29. Sep 10, 2006
    • Tom Lane's avatar
      Rename contains/contained-by operators to @> and <@, per discussion that · ba920e1c
      Tom Lane authored
      agreed these symbols are less easily confused.  I made new pg_operator
      entries (with new OIDs) for the old names, so as to provide backward
      compatibility while making it pretty easy to remove the old names in
      some future release cycle.  This commit only touches the core datatypes,
      contrib will be fixed separately.
      ba920e1c
  30. Jul 14, 2006
  31. Jun 28, 2006
    • Teodor Sigaev's avatar
      Changes · 1f7ef548
      Teodor Sigaev authored
      * new split algorithm (as proposed in http://archives.postgresql.org/pgsql-hackers/2006-06/msg00254.php)
        * possible call pickSplit() for second and below columns
        * add spl_(l|r)datum_exists to GIST_SPLITVEC -
          pickSplit should check its values to use already defined
          spl_(l|r)datum for splitting. pickSplit should set
          spl_(l|r)datum_exists to 'false' (if they was 'true') to
          signal to caller about using spl_(l|r)datum.
        * support for old pickSplit(): not very optimal
          but correct split
      * remove 'bytes' field from GISTENTRY: in any case size of
        value is defined by it's type.
      * split GIST_SPLITVEC to two structures: one for using in picksplit
        and second - for internal use.
      * some code refactoring
      * support of subsplit to rtree opclasses
      
      TODO: add support of subsplit to contrib modules
      1f7ef548
  32. Mar 05, 2006
  33. Nov 07, 2005
  34. Oct 15, 2005
  35. Sep 22, 2005
  36. Jul 01, 2005
  37. Jun 24, 2005
    • Tom Lane's avatar
      Extend r-tree operator classes to handle Y-direction tests equivalent · b90f8f20
      Tom Lane authored
      to the existing X-direction tests.  An rtree class now includes 4 actual
      2-D tests, 4 1-D X-direction tests, and 4 1-D Y-direction tests.
      This involved adding four new Y-direction test operators for each of
      box and polygon; I followed the PostGIS project's lead as to the names
      of these operators.
      NON BACKWARDS COMPATIBLE CHANGE: the poly_overleft (&<) and poly_overright
      (&>) operators now have semantics comparable to box_overleft and box_overright.
      This is necessary to make r-tree indexes work correctly on polygons.
      Also, I changed circle_left and circle_right to agree with box_left and
      box_right --- formerly they allowed the boundaries to touch.  This isn't
      actually essential given the lack of any r-tree opclass for circles, but
      it seems best to sync all the definitions while we are at it.
      b90f8f20
    • Tom Lane's avatar
      Fix rtree and contrib/rtree_gist search behavior for the 1-D box and · 9a09248e
      Tom Lane authored
      polygon operators (<<, &<, >>, &>).  Per ideas originally put forward
      by andrew@supernews and later rediscovered by moi.  This patch just
      fixes the existing opclasses, and does not add any new behavior as I
      proposed earlier; that can be sorted out later.  In principle this
      could be back-patched, since it changes only search behavior and not
      system catalog entries nor rtree index contents.  I'm not currently
      planning to do that, though, since I think it could use more testing.
      9a09248e
  38. May 25, 2005
  39. May 21, 2005
Loading