pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
COMMIT takes long time for read only transaction
2+ messages / 2 participants
[nested] [flat]

* COMMIT takes long time for read only transaction
@ 2011-05-26 18:19 Mario Splivalo <mario.splivalo@megafon.hr>
  2011-05-26 19:50 ` Re: COMMIT takes long time for read only transaction Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 1 reply; 2+ messages in thread

From: Mario Splivalo @ 2011-05-26 18:19 UTC (permalink / raw)
  To: pgsql-admin

Hi, all.

Postgres 8.4.4, quite often I have situation like this:

011-05-26 18:25:38.842 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SET LOG:  duration: 0.029 ms  statement: BEGIN; SET TRANSACTION 
ISOLATION LEVEL READ COMMITTED
2011-05-26 18:25:38.843 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 0.259 ms  statement: SELECT
2011-05-26 18:25:38.847 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 2.205 ms  statement: SELECT
2011-05-26 18:25:38.850 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 0.185 ms  statement: SELECT
2011-05-26 18:25:39.250 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 0.232 ms  statement: SELECT
2011-05-26 18:25:39.252 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 0.289 ms  statement: SELECT
2011-05-26 18:25:39.255 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 0.639 ms  statement: SELECT
2011-05-26 18:25:39.257 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 0.135 ms  statement: SELECT
2011-05-26 18:25:39.258 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
SELECT LOG:  duration: 0.156 ms  statement: SELECT
2011-05-26 18:25:51.624 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
COMMIT LOG:  duration: 11159.202 ms  statement: COMMIT
2011-05-26 18:26:05.788 CEST [16163] <ample@knjiz> [192.168.1.5(32431)] 
COMMIT LOG:  duration: 326.856 ms  statement: COMMIT

This is a grep from a postgres log when I had logging of all statements 
enabled. I did grep by the local pid (16163), and what I don't 
understand is:
- why is first COMMIT taking 11 seconds, when there are only SELECTs in 
the transaction? SELECTS don't call any user defined functions, just 
plain reads from the tables.
- what is that second COMMIT? If I issue COMMIT without 'BEGIN' 
shouldn't I get: "COMMIT WARNING:  there is no transaction in progress"

	Mario



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: COMMIT takes long time for read only transaction
  2011-05-26 18:19 COMMIT takes long time for read only transaction Mario Splivalo <mario.splivalo@megafon.hr>
@ 2011-05-26 19:50 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>
  0 siblings, 0 replies; 2+ messages in thread

From: Kevin Grittner @ 2011-05-26 19:50 UTC (permalink / raw)
  To: Mario Splivalo <mario.splivalo@megafon.hr>; pgsql-admin

Mario Splivalo <mario.splivalo@megafon.hr> wrote:
 
> 2011-05-26 18:25:51.624 CEST [16163] <ample@knjiz>
> [192.168.1.5(32431)] 
> COMMIT LOG:  duration: 11159.202 ms  statement: COMMIT
> 2011-05-26 18:26:05.788 CEST [16163] <ample@knjiz>
> [192.168.1.5(32431)] 
> COMMIT LOG:  duration: 326.856 ms  statement: COMMIT
> 
> This is a grep from a postgres log when I had logging of all
> statements enabled. I did grep by the local pid (16163), and what
> I don't understand is:
> - why is first COMMIT taking 11 seconds, when there are only
> SELECTs in the transaction? SELECTS don't call any user defined
> functions, just plain reads from the tables.
> - what is that second COMMIT? If I issue COMMIT without 'BEGIN' 
> shouldn't I get: "COMMIT WARNING:  there is no transaction in
> progress"
 
Hard to say what's going on without knowing more about your logging
configuration.  If you run this query and post the results it will
help clarify the situation:
 
http://wiki.postgresql.org/wiki/Server_Configuration
 
-Kevin



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2011-05-26 19:50 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-05-26 18:19 COMMIT takes long time for read only transaction Mario Splivalo <mario.splivalo@megafon.hr>
2011-05-26 19:50 ` Kevin Grittner <Kevin.Grittner@wicourts.gov>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox