Re: Cube extension kNN support - Mailing list pgsql-hackers

From Stas Kelvich
Subject Re: Cube extension kNN support
Date
Msg-id 14876F35-0A31-444C-9914-E4C1978BDD80@postgrespro.ru
Whole thread Raw
In response to Re: Cube extension kNN support  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: Cube extension kNN support  (Teodor Sigaev <teodor@sigaev.ru>)
List pgsql-hackers
Hello.

That is updated version of the patch with proper update scripts.

Also i’ve noted that documentation states the wrong thing:

“It does not matter which order the opposite corners of a cube are entered in. The cube functions automatically swap
valuesif needed to create a uniform "lower left — upper right" internal representation." 

But in practice cubes stored "as is" and that leads to problems with getting cubes sorted along specific dimension
directlyfrom index. 
As a simplest workaround i’ve deleted that sentence from docs and implemented two coordinate getters -> and ~>. First
onereturns 
coordinate of cube as it stored, and second returns coordinate of cube normalised to (LL,UR)-form.

Other way to fix thing is to force ’normalization’ while creating cube. But that can produce wrong sorts with already
existingdata. 

> On 09 Jul 2015, at 16:40, Alexander Korotkov <aekorotkov@gmail.com> wrote:
>
> Hi!
>
> On Sat, May 9, 2015 at 6:53 AM, Stas Kelvich <stas.kelvich@gmail.com> wrote:
> Patch is pretty ready, last issue was about changed extension interface, so there should be migration script and
versionbump. 
> Attaching a version with all migration stuff.
>
> I can't see cube--1.0--1.1.sql in the patch. Did forget to include it?
>
> ------
> Alexander Korotkov
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company

Stas Kelvich
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company


Attachment

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Are we sufficiently clear that jsonb containment is nested?
Next
From: Дмитрий Воронин
Date:
Subject: Re: pg_dump