cube_distance does in fact work -- thanks, Guyren!

Here's the actual query I'm using, in case anyone else needs to do this. 
 The second cube(ARRAY[ ]) call would take the 16 elements of the image 
vector that we want to match:

select id, 
cube_distance(
cube(ARRAY[c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, 
c15]), 
cube(ARRAY[211, 64, 120, 24, 139, 246, 11, 161, 29, 88, 252, 112, 218, 147, 
66, 111])
) as distance
from images
order by 2 ASC
limit 5

Cheers,

Chris

On Sunday, April 13, 2014 9:39:25 PM UTC-7, Gisborne wrote:
>
> On Apr 13, 2014, at 8:58 AM, Chris McCann <[email protected]> wrote:
>
> It doesn't look to me like this patch has been added to the cube 
> extension, which I already loaded into Postgres hoping it would provide a 
> solution.  There's a discussion on the Postgres hacker board about maybe 
> adding it to version 9.5 assuming all the tests and benchmarks can be 
> properly added.
>
>
> And the standard cube extension doesn’t work for you? It implements a 
> distance function, so I figured it would meet your needs out of the box.
>
> Regards,
>
> Guyren G Howe
> Relevant Logic LLC
>
> guyren-at-relevantlogic.com ~ http://relevantlogic.com ~ +1 512 784 3178
>
> Ruby/Rails,  Xojo, PHP programming
> PostgreSQL, MySQL database design and consulting
> Technical writing and training
>
> Read my book, Real OOP with REALbasic: <
> http://relevantlogic.com/oop-book/about-the-oop-book.php>
>  
>

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to