Re: [HACKERS] GiST range-contained-by searches versus empty ranges

2011-11-29 Thread Tom Lane
Jeff Davis writes: > On Sat, 2011-11-26 at 19:26 -0500, Tom Lane wrote: >> I'm inclined to propose that we should add some logic to say that >> merging a new item into an existing one is forbidden if the penalty >> function returns plus-infinity for the case. If all existing items on a >> page re

Re: [HACKERS] GiST range-contained-by searches versus empty ranges

2011-11-29 Thread Jeff Davis
On Sat, 2011-11-26 at 19:26 -0500, Tom Lane wrote: > I'm inclined to propose that we should add some logic to say that > merging a new item into an existing one is forbidden if the penalty > function returns plus-infinity for the case. If all existing items on a > page return infinity, a new item

Re: [HACKERS] GiST range-contained-by searches versus empty ranges

2011-11-27 Thread Tom Lane
Alexander Korotkov writes: >> The first solution that comes to mind is to make the penalty and >> picksplit functions forcibly segregate empty ranges from others, that is >> a split will never put empty ranges together with non-empty ones. > Have you seen my patch about GiST for range types? > ht

Re: [HACKERS] GiST range-contained-by searches versus empty ranges

2011-11-27 Thread Alexander Korotkov
> > The first solution that comes to mind is to make the penalty and > picksplit functions forcibly segregate empty ranges from others, that is > a split will never put empty ranges together with non-empty ones. Then, > we can assume that a non-empty internal node doesn't represent any empty > lea

Re: [HACKERS] GiST range-contained-by searches versus empty ranges

2011-11-26 Thread Tom Lane
I wrote: > I started to wonder why the test in range_gist_consistent_int() for > RANGESTRAT_CONTAINED_BY was "return true" (ie, search the entire index) > rather than range_overlaps, which is what is tested in the comparable > case in rtree_internal_consistent(). The regression tests showed me > h

[HACKERS] GiST range-contained-by searches versus empty ranges

2011-11-26 Thread Tom Lane
I started to wonder why the test in range_gist_consistent_int() for RANGESTRAT_CONTAINED_BY was "return true" (ie, search the entire index) rather than range_overlaps, which is what is tested in the comparable case in rtree_internal_consistent(). The regression tests showed me how come: an empty-r