Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-04-23 Thread Bruce Momjian
On Thu, Mar 31, 2016 at 05:46:41PM +0200, Emre Hasegeli wrote: > > Thank you, pushed > > Thank you for working on this. > > I noticed that have overlooked this: > > static RectBox * > -initRectBox() > +initRectBox(void) > { Done, thanks. -- Bruce Momjian

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-31 Thread Emre Hasegeli
> Thank you, pushed Thank you for working on this. I noticed that have overlooked this: static RectBox * -initRectBox() +initRectBox(void) { -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription:

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-30 Thread Teodor Sigaev
Thank you, pushed Emre Hasegeli wrote: I'll try to explain with two-dimensional example over points. ASCII-art: Thank you for the explanation. Should we incorporate this with the patch. added I have worked on the comments of the patch. It is attached. I hope it looks more clear than it

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-27 Thread Emre Hasegeli
>>> I'll try to explain with two-dimensional example over points. ASCII-art: >> >> Thank you for the explanation. Should we incorporate this with the patch. > > added I have worked on the comments of the patch. It is attached. I hope it looks more clear than it was before. >>> +

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-24 Thread Teodor Sigaev
+ * boxtype_spgist.c The names on the file header need to be changed, too. Oops. fixed I'll try to explain with two-dimensional example over points. ASCII-art: Thank you for the explanation. Should we incorporate this with the patch. added + cmp_double(const double a, const double b)

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-24 Thread Emre Hasegeli
> + * boxtype_spgist.c The names on the file header need to be changed, too. > I'll try to explain with two-dimensional example over points. ASCII-art: >| >| > 1 | 2 >| > ---+- >|P > 3 | 4 >

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-22 Thread Teodor Sigaev
Isn't this basically the same thing that the cube contrib module does? (Which has the added benefit of kNN-capable operators). No, cube module introduces new type - N-dimensional box. And adds an index support for it. Current patch suggests non-traditional indexing technique for 2D boxes by

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-22 Thread Teodor Sigaev
tend to think of a *point* as having *zero* dimensions. Would it perhaps be more accurate to say we are treating a 2-dimensional box as a point in 4-dimensional space? Exactly, sorry for ambiguity. -- Teodor Sigaev E-mail: teo...@sigaev.ru

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-22 Thread Jim Nasby
On 3/21/16 7:41 PM, Stas Kelvich wrote: While people tends to use machine learning and regressions models more and more it is interesting to have some general n-dim indexing with kNN, but I think it is different problem and should be solved in a different way. I think one of the issues here

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-21 Thread Stas Kelvich
> On 22 Mar 2016, at 01:47, Jim Nasby wrote: > > On 3/21/16 11:57 AM, Teodor Sigaev wrote: >> A and B are points of intersection of lines. So, box PBCAis a bounding >> box for points contained in 3-rd (see labeling above). For example X >> labeled point is not a

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-21 Thread Jim Nasby
On 3/21/16 11:57 AM, Teodor Sigaev wrote: A and B are points of intersection of lines. So, box PBCAis a bounding box for points contained in 3-rd (see labeling above). For example X labeled point is not a descendace of child node with centroid C because it must be in branch of 1-st quad of

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-21 Thread Stas Kelvich
> On 21 Mar 2016, at 22:38, Kevin Grittner wrote: > > On Mon, Mar 21, 2016 at 11:57 AM, Teodor Sigaev wrote: > >>> I couldn't get the term 4D point. Maybe it means that we are >>> using box datatype as the prefix, but we are not treating them >>> as

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-21 Thread Kevin Grittner
On Mon, Mar 21, 2016 at 11:57 AM, Teodor Sigaev wrote: >> I couldn't get the term 4D point. Maybe it means that we are >> using box datatype as the prefix, but we are not treating them >> as boxes. > > exactly, we treat boxes as 4-dimentional points. I'm not entirely sure I

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-21 Thread Teodor Sigaev
+ *implementation of quad-4d tree over boxes for SP-GiST. Isn't the whole thing actually 3D? No. The idea if this work is a representation of 2d box as 4d point. Quad means quadrant of 2d plane. Originally such kind of tree was developed for 2d point, and each node of tree splits plane on

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-21 Thread Emre Hasegeli
Here are my comments about the operator class implementation: > + *implementation of quad-4d tree over boxes for SP-GiST. Isn't the whole thing actually 3D? > + * For example consider the case of intersection. No need for a new line after this. > + * A quadrant has bounds, but sp-gist

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-18 Thread Teodor Sigaev
Do reconstructedValues is required now? Wouldn't it be cleaner to use the new field on the prefix tree implementation, too? reconstructedValues is needed to reconctruct full indexed value and should match to type info indexed column We haven't had specific memory context for

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-18 Thread Emre Hasegeli
Here are my first comments. I haven't read the actual index implementation, yet. I think traversal value is a useful addition. It is nice that the implementation for the range types is also changed. My questions about them are: Do reconstructedValues is required now? Wouldn't it be cleaner

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-15 Thread Oleg Bartunov
On Mon, Mar 14, 2016 at 9:01 PM, David Steele wrote: > On 2/15/16 10:29 AM, Teodor Sigaev wrote: > > It's very pity but author is not able to continue work on this patch, >> and I would like to raise this flag. >> >> I'd like to add some comments about patches: >> >>

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-03-14 Thread David Steele
On 2/15/16 10:29 AM, Teodor Sigaev wrote: It's very pity but author is not able to continue work on this patch, and I would like to raise this flag. I'd like to add some comments about patches: traversalValue patch adds arbitrary value assoсiated with branch in SP-GiST tree walk. Unlike to

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-02-15 Thread Teodor Sigaev
It's very pity but author is not able to continue work on this patch, and I would like to raise this flag. I'd like to add some comments about patches: traversalValue patch adds arbitrary value assoсiated with branch in SP-GiST tree walk. Unlike to recostructedValue it could be just pointer,

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-01-27 Thread Alvaro Herrera
Alexander Lebedev wrote: > Hello, Hacker. > > * [PATCH] add a box index to sp-gist I closed this patch as "returned with feedback" because the author didn't reply in three months. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA,

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2016-01-04 Thread Alvaro Herrera
CC'ing Teodor because he's author of one of the patches. Alexander Lebedev wrote: > Hello, Hacker. So, can we have a more thorough explanation of what is the point of this patch? If it is supposed to improve the performance of searching for boxes, can we see measurements from some benchmark?

Re: [HACKERS] [PATCH] we have added support for box type in SP-GiST index

2015-10-31 Thread Oleg Bartunov
On Sat, Oct 31, 2015 at 9:49 PM, Alexander Lebedev wrote: > Hello, Hacker. > > * [PATCH] add a box index to sp-gist > > We have extended sp-gist with an index that keeps track of boxes > > We have used ideas underlying sp-gist range implementation to > represent

[HACKERS] [PATCH] we have added support for box type in SP-GiST index

2015-10-31 Thread Alexander Lebedev
Hello, Hacker. * [PATCH] add a box index to sp-gist We have extended sp-gist with an index that keeps track of boxes We have used ideas underlying sp-gist range implementation to represent 2D boxes as points in 4D space. We use quad tree analogue, but in 4-dimensional space. We call