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

From Tom Lane
Subject Re: Materializing a sequential scan
Date
Msg-id 4248.1129783045@sss.pgh.pa.us
Whole thread Raw
In response to Materializing a sequential scan  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
Responses Re: Materializing a sequential scan  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
Re: Materializing a sequential scan  ("Steinar H. Gunderson" <sgunderson@bigfoot.com>)
List pgsql-performance
"Steinar H. Gunderson" <sgunderson@bigfoot.com> writes:
> I'm using PostgreSQL 8.1 beta 3 (packages from Debian experimental), and I
> have a (rather complex) query that seems to take forever -- when the database
> was just installed, it took about 1200ms (which is quite good, considering
> that the 7.4 system this runs on today uses about the same time, but has
> twice as much CPU power and runs sequential scans up to eight times as fast),
> but now I can never even get it to complete. I've tried running it for half
> an hour, but it still doesn't complete, so I'm a bit unsure what's going on.

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.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Steinar H. Gunderson"
Date:
Subject: Materializing a sequential scan
Next
From: Tom Lane
Date:
Subject: Re: Materializing a sequential scan