Skip site navigation (1) Skip section navigation (2)

Re: High CPU load on Postgres Server during Peak times!!!!

From: Craig James <craig_james(at)emolecules(dot)com>
To: Dave Dutcher <dave(at)tridecap(dot)com>
Cc: 'Shiva Raman' <raman(dot)shivag(at)gmail(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: High CPU load on Postgres Server during Peak times!!!!
Date: 2009-09-24 18:45:28
Message-ID: 4ABBBE48.1020104@emolecules.com (view raw or flat)
Thread:
Lists: 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 for you, and you have to do an explicit

  $dbh->commit();

to commit it.

Craig



In response to

Responses

pgsql-performance by date

Next:From: Josh BerkusDate: 2009-09-25 00:25:06
Subject: Re: Regarding Sequential Scans count increase each time we press refresh .
Previous:From: Karl DenningerDate: 2009-09-24 17:55:50
Subject: Re: High CPU load on Postgres Server during Peak times!!!!

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group