From: | "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com> |
---|---|
To: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: Materializing a sequential scan |
Date: | 2005-10-20 10:16:34 |
Message-ID: | 20051020101634.GB11055@samfundet.no |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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/
From | Date | Subject | |
---|---|---|---|
Next Message | Steinar H. Gunderson | 2005-10-20 10:18:47 | Re: Materializing a sequential scan |
Previous Message | Christopher Kings-Lynne | 2005-10-20 08:59:09 | Re: Deleting Records |