Re: Autocommit, isolation level, and vacuum behavior

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jack Orenstein <jack(dot)orenstein(at)hds(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Autocommit, isolation level, and vacuum behavior
Date: 2008-09-10 14:20:24
Message-ID: 20080910142024.GB4399@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Martijn van Oosterhout wrote:

> Vacuum can only clean up stuff older than the oldest open transaction.
> So if you have a transaction which is open for hours then stuff made
> since then it can't be vacuumed. The solution is: don't do that.

Actually it's worse than that: older than the oldest transaction that
was active at the time when the current oldest transaction created its
snapshot.

As for autocommit, my guess is that the driver is doing "COMMIT; BEGIN".
This should not cause much of a problem in 8.3 compared to previous
releases, because the transaction gets its Xid at the time the first
command write command is run (previously it was grabbed when the
transaction started). Also, I thought recent versions of the JDBC
driver did not issue the BEGIN right after COMMIT, so I'm surprised that
there's any visible difference at all.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Filip Rembiałkowski 2008-09-10 14:20:43 Re: You need to rebuild PostgreSQL using --with-libxml.
Previous Message Artis Caune 2008-09-10 14:20:07 plpgsql return select from multiple tables