Re: Statistical Analysis - Mailing list pgsql-general

From Timothy H. Keitt
Subject Re: Statistical Analysis
Date
Msg-id 397CF164.7034DBEF@nceas.ucsb.edu
Whole thread Raw
In response to RE: Statistical Analysis  ("Nathan Barnett" <nbarnett@cellularphones.com>)
List pgsql-general
Tom Lane wrote:
>
> Note that this isn't necessarily going to fix your performance problem,
> since a scan of the whole input table is still going to be required.
> But if the expensive processing was somewhere downstream of that basic
> scan, it should help.
>

The only way that I know of to do this fast is to insert the items in
random order.  I've done this (in C++, not postgres) using a map
(b-tree) data structure: insert key-value pairs with the key being a
random number; then pop entries off the tail of the map as needed.

Tim

--
Timothy H. Keitt
National Center for Ecological Analysis and Synthesis
735 State Street, Suite 300, Santa Barbara, CA 93101
Phone: 805-892-2519, FAX: 805-892-2510
http://www.nceas.ucsb.edu/~keitt/

pgsql-general by date:

Previous
From: Dave Burbidge
Date:
Subject: RE: PostgreSQL, ODBC, Access
Next
From: "anuj"
Date:
Subject: RE: how connect visual basic to pgsql?