Re: General DB Tuning

From: Mark Rae <mrae(at)purplebat(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Brent Henry <bh_pgperf(at)yahoo(dot)com>, Dennis <dennis(at)works4me(dot)com>, Tom Arthurs <tarthurs(at)jobflash(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: General DB Tuning
Date: 2005-07-13 10:07:40
Message-ID: 20050713100740.GA27912@purplebat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, Jul 13, 2005 at 09:52:20AM +0800, Christopher Kings-Lynne wrote:
> The 8.0.2 jdbc driver uses real prepared statements instead of faked
> ones. The problem is the new protocol (that the 8.0.2 driver users) has
> a bug where protocol-prepared queries don't get logged properly.
> I don't know if it's been fixed...

It's not in 8.0.3, but I was having the same problems with DBD::Pg so
I backported some of it and also changed the code so that it listed the
values of the bind parameters, so you get something like

LOG: statement: SELECT sr.name,sr.seq_region_id, sr.length, 1 FROM seq_region sr WHERE sr.name = $1 AND sr.coord_system_id = $2
LOG: binding: "dbdpg_2" with 2 parameters
LOG: bind "dbdpg_2" $1 = "20"
LOG: bind "dbdpg_2" $2 = "1"
LOG: statement: EXECUTE [PREPARE: SELECT sr.name,sr.seq_region_id, sr.length, 1 FROM seq_region sr WHERE sr.name = $1 AND sr.coord_system_id = $2]
LOG: duration: 0.164 ms

I've attached a patch in case anyone finds it useful.

-Mark

Attachment Content-Type Size
timing.patch text/plain 3.8 KB

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Nicolas Beaume 2005-07-13 10:08:54 large table vs multiple smal tables
Previous Message Jean-Max Reymond 2005-07-13 08:20:51 size of cache