Re: big transaction slows down over time - but disk seems

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Ben <bench(at)silentmedia(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: big transaction slows down over time - but disk seems
Date: 2006-11-01 09:39:59
Message-ID: 45486B6F.2000704@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Ben wrote:
> I've got a long-running, update-heavy transaction that increasingly
> slows down the longer it runs. I would expect that behavior, if there
> was some temp file creation going on. But monitoring vmstat over the
> life of the transaction shows virtually zero disk activity. Instead, the
> system has its CPU pegged the whole time.
>
> So.... why the slowdown? Is it a MVCC thing? A side effect of calling
> stored proceedures a couple hundred thousand times in a single
> transaction? Or am I just doing something wrong?

My guess is that the updates are creating a lot of old row versions, and
a command within the transaction is doing a seq scan that has to scan
through all of them. Or something like that. It's hard to tell without
more details.

Calling stored procedures repeatedly shouldn't cause a slowdown over time.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Ivan Voras 2006-11-01 12:06:09 Re: MVCC & indexes?
Previous Message Andreas Kostyrka 2006-11-01 09:21:01 Re: big transaction slows down over time - but disk