pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Kirkwood <markir@paradise.net.nz>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Andrew Lazarus <andrew@pillette.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: index structure for 114-dimension vector
Date: Sat, 21 Apr 2007 11:42:35 +1200
Message-ID: <46294FEB.9010909@paradise.net.nz> (raw)
In-Reply-To: <1177105284.28383.31.camel@dogma.v10.wvs>
References: <b42b73150704170917n33ebcdc8wc852a3fa02fd8bb5@mail.gmail.com>
	<01db01c781e4$c700bf30$2e00a8c0@tridecap.com>
	<b42b73150704181716wb1600aey8761b6793d3fd702@mail.gmail.com>
	<1217328326.20070420120729@pillette.com>
	<1177105284.28383.31.camel@dogma.v10.wvs>

Jeff Davis wrote:
> On Fri, 2007-04-20 at 12:07 -0700, Andrew Lazarus wrote:
>> I have a table with 2.5 million real[] arrays. (They are points in a
>> time series.) Given a new array X, I'd like to find, say, the 25
>> closest to X in some sense--for simplification, let's just say in the
>> usual vector norm. Speed is critical here, and everything I have tried
>> has been too slow.
>>
>> I imported the cube contrib package, and I tried creating an index on
>> a cube of the last 6 elements, which are the most important. Then I
> 
> Have you tried just making normal indexes on each of the last 6 elements
> and see if postgresql will use a BitmapAnd to combine them? 
> 
>

I don't think that will work for the vector norm i.e:

|x - y| = sqrt(sum over j ((x[j] - y[j])^2))


Cheers

Mark



view thread (12+ messages)  latest in thread

Message-ID: <46294FEB.9010909@paradise.net.nz>
Permalink:  ../46294FEB.9010909@paradise.net.nz/
Also on:    postgresql.org/message-id/46294FEB.9010909@paradise.net.nz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: markir@paradise.net.nz, pgsql@j-davis.com, andrew@pillette.com
  Subject: Re: index structure for 114-dimension vector
  In-Reply-To: <46294FEB.9010909@paradise.net.nz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox