Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2013-03-08 Thread Heikki Linnakangas
On 03.03.2013 19:42, Alexander Korotkov wrote: This patch only adds one more operator to already committed new opclass. Tests already cover this case. Without patch corresponding test leads to sequential scan instead of index scan. Thanks, committed with some trivial cleanup. However, I can't

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2013-03-03 Thread Alexander Korotkov
On Mon, Mar 4, 2013 at 6:53 AM, Craig Ringer wrote: > On 03/04/2013 01:42 AM, Alexander Korotkov wrote: > > > > This patch only adds one more operator to already committed new > > opclass. Tests already cover this case. Without patch corresponding > > test leads to sequential scan instead of inde

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2013-03-03 Thread Craig Ringer
On 03/04/2013 01:42 AM, Alexander Korotkov wrote: > > This patch only adds one more operator to already committed new > opclass. Tests already cover this case. Without patch corresponding > test leads to sequential scan instead of index scan. However, I can't > see any documentation changes about a

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2013-03-03 Thread Alexander Korotkov
On Sun, Mar 3, 2013 at 6:37 PM, Craig Ringer wrote: > On 02/09/2013 05:36 PM, Alexander Korotkov wrote: > > > Your comments and refactoring looks good for me. > > This patch is currently flagged as waiting for author. Have you had a > chance to test and examine Jeff's changes in more detail? Wo

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2013-03-03 Thread Craig Ringer
On 02/09/2013 05:36 PM, Alexander Korotkov wrote: > > Your comments and refactoring looks good for me. This patch is currently flagged as waiting for author. Have you had a chance to test and examine Jeff's changes in more detail? Would you consider giving us a summary of the status of this work -

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2013-02-09 Thread Alexander Korotkov
Hi! On Mon, Dec 17, 2012 at 2:42 PM, Jeff Davis wrote: > I have attached a patch with some significant edits. > > * In your patch, there was still an inconsistency between the comment > for bounds_adjacent and the code. I refactored it to ensure it always > takes the upper bound as boundA, and t

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-12-17 Thread Jeff Davis
On Fri, 2012-12-14 at 01:31 +0400, Alexander Korotkov wrote: > Hi! > Hi! I have attached a patch with some significant edits. * In your patch, there was still an inconsistency between the comment for bounds_adjacent and the code. I refactored it to ensure it always takes the upper bound as bound

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-12-13 Thread Alexander Korotkov
Hi! On Sun, Nov 4, 2012 at 11:41 PM, Jeff Davis wrote: > On Fri, 2012-11-02 at 12:47 +0400, Alexander Korotkov wrote: > > > Right version of patch is attached. > > > * In bounds_adjacent, there's no reason to flip the labels back. > Fixed. > * Comment should indicate more explicitly that boun

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-12-08 Thread Andres Freund
Hi Alexander, On 2012-11-04 11:41:48 -0800, Jeff Davis wrote: > On Fri, 2012-11-02 at 12:47 +0400, Alexander Korotkov wrote: > > > Right version of patch is attached. > > > * In bounds_adjacent, there's no reason to flip the labels back. > * Comment should indicate more explicitly that bounds_adja

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-11-04 Thread Jeff Davis
On Fri, 2012-11-02 at 12:47 +0400, Alexander Korotkov wrote: > Right version of patch is attached. > * In bounds_adjacent, there's no reason to flip the labels back. * Comment should indicate more explicitly that bounds_adjacent is sensitive to the argument order. * In bounds_adjacent, it appears

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-11-02 Thread Alexander Korotkov
On Sun, Oct 21, 2012 at 11:22 AM, Jeff Davis wrote: > On Tue, 2012-09-04 at 17:45 +0400, Alexander Korotkov wrote: > > On Mon, Aug 20, 2012 at 12:25 AM, Jeff Davis > > wrote: > > I am taking a look at this patch now. A few quick comments: > > > > * It looks like bounds_adjacent m

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-10-21 Thread Jeff Davis
On Tue, 2012-09-04 at 17:45 +0400, Alexander Korotkov wrote: > On Mon, Aug 20, 2012 at 12:25 AM, Jeff Davis > wrote: > I am taking a look at this patch now. A few quick comments: > > * It looks like bounds_adjacent modifies it's by-reference > arguments, >

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-10-18 Thread Alvaro Herrera
Jeff Davis escribió: > On Sat, 2012-08-18 at 18:10 +0400, Alexander Korotkov wrote: > > > > Thanks! There is a separate patch for adjacent. I've reworked adjacent > > check in order to make it more clear. > > I am taking a look at this patch now. A few quick comments: > * I tried some larger tes

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-09-04 Thread Alexander Korotkov
On Mon, Aug 20, 2012 at 12:25 AM, Jeff Davis wrote: > I am taking a look at this patch now. A few quick comments: > > * It looks like bounds_adjacent modifies it's by-reference arguments, > which is a little worrying to me. The lower/upper labels are flipped > back, but the inclusivities are not.

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-08-20 Thread Tom Lane
Jeff Davis writes: > On Sat, 2012-07-28 at 17:50 -0400, Tom Lane wrote: >> which would come >> back to bite us if we ever try to support index-only scans with SPGiST. > I'm confused: > http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=92203624934095163f8b57b5b3d7bbd2645da2c8 Sorry, I

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-08-19 Thread Jeff Davis
On Sat, 2012-07-28 at 17:50 -0400, Tom Lane wrote: > which would come > back to bite us if we ever try to support index-only scans with SPGiST. I'm confused: http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=92203624934095163f8b57b5b3d7bbd2645da2c8 And the patch that was just committ

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-08-19 Thread Jeff Davis
On Sat, 2012-08-18 at 18:10 +0400, Alexander Korotkov wrote: > On Thu, Aug 16, 2012 at 3:46 PM, Heikki Linnakangas > wrote: > I committed the patch now, but left out the support for > adjacent for now. Not because there was necessarily anything > wrong with that, but becaus

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-08-18 Thread Alexander Korotkov
On Thu, Aug 16, 2012 at 3:46 PM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > I committed the patch now, but left out the support for adjacent for now. > Not because there was necessarily anything wrong with that, but because I > have limited time for reviewing, and the rest

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-08-16 Thread Heikki Linnakangas
On 09.08.2012 18:42, Alexander Korotkov wrote: In this revision of patch I tried to handle conditions more generally using variables minLower, maxLower, minUpper, maxUpper, inclusive and strictEmpty. However some strategies still contain additional logic. Thanks, that clarified the code tremend

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-08-09 Thread Alexander Korotkov
In this revision of patch I tried to handle conditions more generally using variables minLower, maxLower, minUpper, maxUpper, inclusive and strictEmpty. However some strategies still contain additional logic. What is our conclusion about saving previous choice for RANGESTRAT_ADJACENT strategy? ---

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-08-06 Thread Heikki Linnakangas
Just to check where we stand on this: Are you going to send a finalized version of this patch, based on the one I sent earlier, or should I pick up that version and try to get it into committable state? On 23.07.2012 10:37, Alexander Korotkov wrote: On Fri, Jul 20, 2012 at 3:48 PM, Heikki Linn

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-28 Thread Tom Lane
Heikki Linnakangas writes: > On 29.07.2012 00:50, Tom Lane wrote: >> We could possibly extend the API to allow a different type to be used >> for this, but then it wouldn't be "reconstructed data" in any sense of >> the word; so I think it'd be abuse of the concept --- which would come >> back to

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-28 Thread Heikki Linnakangas
On 29.07.2012 00:50, Tom Lane wrote: Heikki Linnakangas writes: Also, I wonder if we really need to reconstruct the "previous" value in a RANGESTRAT_ADJACENT search. ISTM we only need to remember which of the two lines we are chasing. For example, if you descend to quadrant 2 because there migh

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-28 Thread Tom Lane
Heikki Linnakangas writes: > Also, I wonder if we really need to reconstruct the "previous" value in > a RANGESTRAT_ADJACENT search. ISTM we only need to remember which of the > two lines we are chasing. For example, if you descend to quadrant 2 > because there might be a point there that lies

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-28 Thread Heikki Linnakangas
On 23.07.2012 10:37, Alexander Korotkov wrote: On Fri, Jul 20, 2012 at 3:48 PM, Heikki Linnakangas< heikki.linnakan...@enterprisedb.com> wrote: It would be nice to have an introduction, perhaps as a file comment at the top of rangetypes_spgist.c, explaining how the quad tree works. I have a ge

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-20 Thread Heikki Linnakangas
On 13.07.2012 02:00, Alexander Korotkov wrote: Done. There are separate patch for get rid of TrickFunctionCall2 and version of SP-GiST for ranges based on that patch. Looking at the SP-GiST patch now.. It would be nice to have an introduction, perhaps as a file comment at the top of rangetype

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-18 Thread Alexander Korotkov
On Thu, Jul 19, 2012 at 12:22 AM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > On 13.07.2012 02:00, Alexander Korotkov wrote: > >> On Thu, Jul 12, 2012 at 10:29 AM, Heikki Linnakangas< >> heikki.linnakangas@**enterprisedb.com> >> wrote: >> >> Thanks. Can you do something ab

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-18 Thread Heikki Linnakangas
On 13.07.2012 02:00, Alexander Korotkov wrote: On Thu, Jul 12, 2012 at 10:29 AM, Heikki Linnakangas< heikki.linnakan...@enterprisedb.com> wrote: Thanks. Can you do something about TrickFunctionCall2, please? ( http://archives.postgresql.**org/message-id/4FE2C968.** 2010...@enterprisedb.com

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-11 Thread Heikki Linnakangas
On 12.07.2012 02:11, Alexander Korotkov wrote: On Thu, Jul 12, 2012 at 3:03 AM, Alexander Korotkovwrote: On Tue, Jul 3, 2012 at 10:51 AM, Jeff Davis wrote: Also, it would be helpful to add a couple tests to rangetypes.sql. New version of patch is attached. Oops, forgot to include one c

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-03 Thread Alexander Korotkov
On Tue, Jul 3, 2012 at 10:51 AM, Jeff Davis wrote: > On Mon, 2012-07-02 at 23:47 -0700, Jeff Davis wrote: > > On Thu, 2012-06-14 at 02:56 +0400, Alexander Korotkov wrote: > > > Hackers, > > > > > > > > > attached patch implements quad-tree on ranges. Some performance > > > results in comparison w

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-03 Thread Jeff Davis
On Mon, 2012-07-02 at 23:47 -0700, Jeff Davis wrote: > * Perhaps I'm mistaken, but the following code in getQuadrant() looks > wrong to me, shouldn't the 1 and 2 be reversed? > > if (range_cmp_bounds(typcache, &upper, ¢roidUpper) >= 0) > return 1; > else > r

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-02 Thread Jeff Davis
On Mon, 2012-07-02 at 23:47 -0700, Jeff Davis wrote: > On Thu, 2012-06-14 at 02:56 +0400, Alexander Korotkov wrote: > > Hackers, > > > > > > attached patch implements quad-tree on ranges. Some performance > > results in comparison with current GiST indexing. > > Index creation is slightly slower.

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-07-02 Thread Jeff Davis
On Thu, 2012-06-14 at 02:56 +0400, Alexander Korotkov wrote: > Hackers, > > > attached patch implements quad-tree on ranges. Some performance > results in comparison with current GiST indexing. > Index creation is slightly slower. Probably, it need some > investigation. Search queries on SP-GiST

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-06-22 Thread Jeff Davis
On Thu, 2012-06-14 at 02:56 +0400, Alexander Korotkov wrote: > Hackers, > > > attached patch implements quad-tree on ranges. Some performance > results in comparison with current GiST indexing. > Index creation is slightly slower. Probably, it need some > investigation. Search queries on SP-GiST

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-06-21 Thread Tom Lane
Alexander Korotkov writes: > On Thu, Jun 21, 2012 at 11:12 AM, Heikki Linnakangas < > heikki.linnakan...@enterprisedb.com> wrote: >> I don't think we want to expose TrickFunctionCall2(). Not with that name, >> anyway. Perhaps we should refactor the functions called this way, >> range_adjacent, ran

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-06-21 Thread Alexander Korotkov
On Thu, Jun 14, 2012 at 2:56 AM, Alexander Korotkov wrote: > attached patch implements quad-tree on ranges. Some performance results in > comparison with current GiST indexing. > Index creation is slightly slower. Probably, it need some investigation. > Search queries on SP-GiST use much more page

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-06-21 Thread Alexander Korotkov
On Thu, Jun 21, 2012 at 11:12 AM, Heikki Linnakangas < heikki.linnakan...@enterprisedb.com> wrote: > On 14.06.2012 01:56, Alexander Korotkov wrote: > >> Hackers, >> >> attached patch implements quad-tree on ranges. Some performance results in >> comparison with current GiST indexing. >> > > @@ -7

Re: [HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-06-21 Thread Heikki Linnakangas
On 14.06.2012 01:56, Alexander Korotkov wrote: Hackers, attached patch implements quad-tree on ranges. Some performance results in comparison with current GiST indexing. @@ -788,7 +774,7 @@ range_super_union(TypeCacheEntry *typcache, RangeType * r1, R angeType * r2) * part of the relcache

[HACKERS] SP-GiST for ranges based on 2d-mapping and quad-tree

2012-06-13 Thread Alexander Korotkov
Hackers, attached patch implements quad-tree on ranges. Some performance results in comparison with current GiST indexing. Index creation is slightly slower. Probably, it need some investigation. Search queries on SP-GiST use much more pages. However this comparison can be not really correct, beca