From: Rod Taylor <pg@rbt.ca>
To: David Teran <david.teran@cluster9.com>
Cc: PgSQL Performance ML <pgsql-performance@postgresql.org>
Subject: Re: speeding up a select with C function?
Date: Sun, 07 Mar 2004 10:02:55 -0500
Message-ID: <1078671774.57624.52.camel@jester> (raw)
In-Reply-To: <7F2B9EA0-702C-11D8-9DA8-000A95C496AC@cluster9.com>
References: <7F2B9EA0-702C-11D8-9DA8-000A95C496AC@cluster9.com>
> 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
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: pg@rbt.ca, david.teran@cluster9.com
Subject: Re: speeding up a select with C function?
In-Reply-To: <1078671774.57624.52.camel@jester>
* 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