Re: stored proc and inserting hundreds of thousands of rows - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: stored proc and inserting hundreds of thousands of rows
Date
Msg-id 4DBC106E020000250003D0A3@gw.wicourts.gov
Whole thread Raw
In response to Re: stored proc and inserting hundreds of thousands of rows  (Joel Reymont <joelr1@gmail.com>)
Responses Re: stored proc and inserting hundreds of thousands of rows  (Joel Reymont <joelr1@gmail.com>)
List pgsql-performance
Joel Reymont <joelr1@gmail.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

pgsql-performance by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: stored proc and inserting hundreds of thousands of rows
Next
From: Joel Reymont
Date:
Subject: Re: stored proc and inserting hundreds of thousands of rows