From: Steinar H. Gunderson <sgunderson@bigfoot.com>
To: pgsql-performance@postgresql.org
Subject: Re: Materializing a sequential scan
Date: Thu, 20 Oct 2005 12:16:34 +0200
Message-ID: <20051020101634.GB11055@samfundet.no> (raw)
In-Reply-To: <4248.1129783045@sss.pgh.pa.us>
References: <20051019174544.GA32303@samfundet.no>
<4248.1129783045@sss.pgh.pa.us>
On Thu, Oct 20, 2005 at 12:37:25AM -0400, Tom Lane wrote:
> That mdb_gruppekobling_transitiv_tillukning function looks awfully
> grotty ... how many rows does it return, and how long does it take to
> run by itself? How often does its temp table get vacuumed? A quick
> band-aid might be to use TRUNCATE instead of DELETE FROM to clean the
> table ... but if I were you I'd try to rewrite the function entirely.
It returns 752 rows, and the table is autovacuumed. If I run the queries
manually, they take ~15ms in all -- for some odd reason, the function in itself
varies between 40 and 500ms, though...
I tried using TRUNCATE earlier, but if anything, it made the function slower
(might just have been zero difference, though). I also had written the
function differently (using a series of depth-first searches), but it was
awfully slow even after a lot of tweaking, so it was not really worth it...
/* Steinar */
--
Homepage: http://www.sesse.net/
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: sgunderson@bigfoot.com
Subject: Re: Materializing a sequential scan
In-Reply-To: <20051020101634.GB11055@samfundet.no>
* 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