Re: Materializing a sequential scan - Mailing list pgsql-performance

From Steinar H. Gunderson
Subject Re: Materializing a sequential scan
Date
Msg-id 20051020101634.GB11055@samfundet.no
Whole thread Raw
In response to Re: Materializing a sequential scan  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-performance
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/


pgsql-performance by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: Deleting Records
Next
From: "Steinar H. Gunderson"
Date:
Subject: Re: Materializing a sequential scan