Re: High CPU load on Postgres Server during Peak times!!!! - Mailing list pgsql-performance

From Craig James
Subject Re: High CPU load on Postgres Server during Peak times!!!!
Date
Msg-id 4ABBBE48.1020104@emolecules.com
Whole thread Raw
In response to Re: High CPU load on Postgres Server during Peak times!!!!  ("Dave Dutcher" <dave@tridecap.com>)
Responses Re: High CPU load on Postgres Server during Peak times!!!!  (Gerhard Wiesinger <lists@wiesinger.com>)
List pgsql-performance
Dave Dutcher wrote:
> You need a COMMIT for every BEGIN.  If you just run a SELECT statement
> without first beginning a transaction, then you should not end up with a
> connection that is Idle in Transaction.  If you are beginning a transaction,
> doing a select, and then not committing, then yes that is a bug.

The BEGIN can be hidden, though.  For example, if the application is written in Perl,

  $dbh = DBI->connect($dsn, $user, $pass, {AutoCommit => 0});

will automatically start a transaction the first time you do anything.  Under the covers, the Perl DBI issues the BEGIN
foryou, and you have to do an explicit 

  $dbh->commit();

to commit it.

Craig



pgsql-performance by date:

Previous
From: Karl Denninger
Date:
Subject: Re: High CPU load on Postgres Server during Peak times!!!!
Next
From: Josh Berkus
Date:
Subject: Re: Regarding Sequential Scans count increase each time we press refresh .