Re: Read only transactions - Commit or Rollback

From: Michael Riess <mlriess(at)gmx(dot)de>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Read only transactions - Commit or Rollback
Date: 2005-12-20 12:05:30
Message-ID: do8s24$ie4$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Markus Schaber schrieb:
> Hello,
>
> We have a database containing PostGIS MAP data, it is accessed mainly
> via JDBC. There are multiple simultaneous read-only connections taken
> from the JBoss connection pooling, and there usually are no active
> writers. We use connection.setReadOnly(true).
>
> Now my question is what is best performance-wise, if it does make any
> difference at all:
>
> Having autocommit on or off? (I presume "off")

If you are using large ResultSets, it is interesting to know that
Statement.setFetchSize() does not do anything as long as you have
autocommit on. So you might want to always disable autocommit and set a
reasonable fetch size with large results, or otherwise have serious
memory problems in Java/JDBC.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Andreas Seltenreich 2005-12-20 12:27:05 Re: Read only transactions - Commit or Rollback
Previous Message Markus Schaber 2005-12-20 12:03:15 Re: Read only transactions - Commit or Rollback