| From: | "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> | 
|---|---|
| To: | "Joel Reymont" <joelr1(at)gmail(dot)com>,"Pierre C" <lists(at)peufeu(dot)com> | 
| Cc: | "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org> | 
| Subject: | Re: stored proc and inserting hundreds of thousands of rows | 
| Date: | 2011-04-30 18:36:46 | 
| Message-ID: | 4DBC106E020000250003D0A3@gw.wicourts.gov | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-performance | 
Joel Reymont <joelr1(at)gmail(dot)com> wrote:
 
> I'm calculating distance between probability vectors, e.g. topics
> that a document belongs to and the topics of an ad.
> 
> The distance function is already a C function. Topics are
> float8[150].
> 
> Distance is calculated against all documents in the database
 
There's probably a way to index that so that you don't need to do a
full calculation against all documents in the database each time. 
It may even be amenable to knnGiST indexing (a new feature coming in
9.1), which would let you do your select with an ORDER BY on the
distance.
 
PostgreSQL has a lot of very cool features you just don't have in
any other product!  :-)
 
-Kevin
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Joel Reymont | 2011-04-30 21:15:23 | Re: stored proc and inserting hundreds of thousands of rows | 
| Previous Message | Kevin Grittner | 2011-04-30 18:24:12 | Re: stored proc and inserting hundreds of thousands of rows |