we are using jdbc -- the "log_min_duration_statement = 3000 " statement works fine for me. Looks like there's no other work around for the bug(?). Not sure since I have no interest in logging a million statements a day, I only want to see the poorly performing hits.

Brent Henry wrote:
Yes, that is exactly what I want to use!

Unfortunately, it doesn't work if you access postgres
through a JDBC connection.  I don't know why.  I found
a posting from back in February which talks aobut this
a little:


But I can't find anywhere where someone has fixed it. Am I the only one accessing postgres through JDBC?


--- Tom Arthurs <[EMAIL PROTECTED]> wrote:

I have this in my postgresql.conf file and it works
fine (set the min to whatever you want to log)
log_min_duration_statement = 3000 # -1 is disabled,
in milliseconds.

Another setting that might get what you want:

#log_duration = false

uncomment and change to true.

From the docs:


 Causes the duration of every completed statement
which satisfies log_statement to be logged. When using this option, if you are not using syslog, it is recommended that you log the PID or session ID using log_line_prefix so that you can link the statement to the duration using the process ID or session ID. The default is off. Only superusers can change this setting.

Brent Henry wrote:

Help!  After recently migrating to Postgres 8,


discovered to my horror that I can't determine


queries are poorly performing anymore because the
logging has drastically changed and no longer


durations for anything done through JDBC.

So I'm desperately trying to do performance tuning


my servers and have no way to sort out which
statements are the slowest.

Does anyone have any suggestions?  How do you
determine what queries are behaving badly when you
can't get durations out of the logs?

I have a perl script that analyzes the output from
Postgres 7 logs and it works great!  But it relies


the duration being there.

I did some searches on postgresql.org mailing


and have seen a few people discussing this


but noone seems to be too worried about it.  Is


a simple work-around?





Sell on Yahoo! Auctions – no fees. Bid on great


---------------------------(end of


TIP 5: don't forget to increase your free space

map settings

---------------------------(end of
TIP 2: Don't 'kill -9' the postmaster

Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Reply via email to