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

From Dave Dutcher
Subject Re: High CPU load on Postgres Server during Peak times!!!!
Date
Msg-id 11E13D6A17F84B848770849770B08FEE@tridecap.com
Whole thread Raw
In response to Re: High CPU load on Postgres Server during Peak times!!!!  (Shiva Raman <raman.shivag@gmail.com>)
Responses Re: High CPU load on Postgres Server during Peak times!!!!
Re: High CPU load on Postgres Server during Peak times!!!!
List pgsql-performance
>From: Shiva Raman
>Subject: Re: [PERFORM] High CPU load on Postgres Server during Peak
times!!!!
>
>Andy Colson Wrote :  ,
>>Eww.  I think that's bad.  A connection that has a transaction open will
cause lots of row versions,
>>which use up ram, and make it slower to step through the table (even with
an index).  You really need
>>to fix up your code and make sure you commit transactions.  (any statement
(select, insert, update) will
>>start a new transaction that you need to explicitly commit).
>
>With reference to this suggestion by Andy Colson, we checked the
application code and found that only
>INSERT, UPDATE  has COMMIT  and SELECT has no commit, We are using a lot of
"Ajax Suggest" in the all
>the forms accessed for fetching the data using SELECT statements which are
not explicitly committed.
>We have started updating the code on this.

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.

Dave





pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Use of sequence rather than index scan for one text column on one instance of a database
Next
From: keshav upadhyaya
Date:
Subject: Regarding Sequential Scans count increase each time we press refresh .