Skip site navigation (1) Skip section navigation (2)

Re: Materializing a sequential scan

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 (view raw or flat)
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/


In response to

pgsql-performance by date

Next:From: Steinar H. GundersonDate: 2005-10-20 10:18:47
Subject: Re: Materializing a sequential scan
Previous:From: Christopher Kings-LynneDate: 2005-10-20 08:59:09
Subject: Re: Deleting Records

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group