Re: SSI slows down over time

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Ryan Johnson <ryan(dot)johnson(at)cs(dot)utoronto(dot)ca>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: SSI slows down over time
Date: 2014-04-14 15:54:03
Message-ID: 1397490843.97407.YahooMailBasic@web122304.mail.ne1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Ryan Johnson <ryan(dot)johnson(at)cs(dot)utoronto(dot)ca> wrote:

> what factors might cause a prepared transaction to exist in the
> first place?

As part of a "distributed transaction" using "two phase commit" a
PREPARE TRANSACTION statement would have had to run against
PostgreSQL:

http://www.postgresql.org/docs/current/interactive/sql-prepare-transaction.html

> I'm running a single-node db, and I've had only normal database
> shutdowns, so I wouldn't have expected any.

Prepared transactions survive shutdowns, normal or not, so that
doesn't matter; but prepared transactions are normally used with a
transaction manager coordinating transactions among multiple data
stores. On the other hand, I have seen cases where a developer
"playing around" with database features has created one. And using
them with a "home-grown" transaction manager rather than a mature
product is risky; there are some non-obvious pitfalls to avoid.

Anyway, you may have found a bug, but most of what you're seeing
could be caused by a prepared transaction sitting around
indefinitely, so it's something to check before looking at other
possible causes. If you have a way to reproduce this from a new
cluster, please share it. That always makes diagnosis much easier.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Robert DiFalco 2014-04-14 16:27:29 Approach to Data Summary and Analysis
Previous Message Craig James 2014-04-14 15:35:45 Re: Getting query plan alternatives from query planner?