Re: SSI slows down over time - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: SSI slows down over time
Date
Msg-id 1397490843.97407.YahooMailBasic@web122304.mail.ne1.yahoo.com
Whole thread Raw
In response to Re: SSI slows down over time  (Ryan Johnson <ryan.johnson@cs.utoronto.ca>)
List pgsql-performance
Ryan Johnson <ryan.johnson@cs.utoronto.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



pgsql-performance by date:

Previous
From: Craig James
Date:
Subject: Re: Getting query plan alternatives from query planner?
Next
From: Robert DiFalco
Date:
Subject: Approach to Data Summary and Analysis