Re: speeding up a select with C function? - Mailing list pgsql-performance

From Rod Taylor
Subject Re: speeding up a select with C function?
Date
Msg-id 1078671774.57624.52.camel@jester
Whole thread Raw
In response to speeding up a select with C function?  (David Teran <david.teran@cluster9.com>)
List pgsql-performance
> I have run vacuum analyze before executing the statements. I wonder now
> if there is any chance to speed this up.

Is this an active table for writes? You may want to take a look at
CLUSTER. In some circumstances, it can take an order of magnitude off
the query time by allowing less pages to be retrieved from disk.

Other than that, if you're willing to drop performance of all queries
not hitting the table to speed up this one, you can pin the index and
table into memory (cron job running a select periodically to ensure it
sticks).

Shrink the actual data size (Drop the OID column, use a smallint instead
of an integer, etc.)


One final option is to alter PostgreSQL into possibly doing a
sudo-sequential scan on the table when reading indexes, rather than
pulling data from the table in a random order as it is found in the
index. This is a rather complex project, but doable.
http://momjian.postgresql.org/cgi-bin/pgtodo?performance


pgsql-performance by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Fixed width rows faster?
Next
From: "Steven Butler"
Date:
Subject: Using bigint needs explicit cast to use the index