pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Steinar H. Gunderson <sgunderson@bigfoot.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Materializing a sequential scan
Date: Thu, 20 Oct 2005 00:37:25 -0400
Message-ID: <4248.1129783045@sss.pgh.pa.us> (raw)
In-Reply-To: <20051019174544.GA32303@samfundet.no>
References: <20051019174544.GA32303@samfundet.no>

"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



view thread (13+ messages)  latest in thread

Message-ID: <4248.1129783045@sss.pgh.pa.us>
Permalink:  ../4248.1129783045@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4248.1129783045@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sgunderson@bigfoot.com
  Subject: Re: Materializing a sequential scan
  In-Reply-To: <4248.1129783045@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox