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

Re: Materializing a sequential scan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Steinar H(dot) Gunderson" <sgunderson(at)bigfoot(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Materializing a sequential scan
Date: 2005-10-20 04:37:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
"Steinar H. Gunderson" <sgunderson(at)bigfoot(dot)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

In response to


pgsql-performance by date

Next:From: Tom LaneDate: 2005-10-20 04:58:51
Subject: Re: Materializing a sequential scan
Previous:From: Steinar H. GundersonDate: 2005-10-19 17:45:44
Subject: Materializing a sequential scan

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