Log Slow Queries

Started by MaRCeLO PeReiRAabout 20 years ago3 messagesgeneral
Jump to latest
#1MaRCeLO PeReiRA
gandalf_mp@yahoo.com.br

Hi Guys,

Is there a feature in PostgreSQL like
"--log-slow-queries"(MySQL) ???

Regards,
Marcelo P.

_______________________________________________________
Abra sua conta no Yahoo! Mail: 1GB de espa�o, alertas de e-mail no celular e anti-spam realmente eficaz.
http://br.info.mail.yahoo.com/

#2Chris
dmagick@gmail.com
In reply to: MaRCeLO PeReiRA (#1)
Re: Log Slow Queries

MaRCeLO PeReiRA wrote:

Hi Guys,

Is there a feature in PostgreSQL like
"--log-slow-queries"(MySQL) ???

Unfortunately not.

What you can do is edit your postgresql.conf file and set:

log_min_duration_statement

See
http://www.postgresql.org/docs/8.1/interactive/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN
for more info.

This will go into the main log file, it won't create a separate log (as
slow-queries allows you to do in mysql).

--
Postgresql & php tutorials
http://www.designmagick.com/

#3Martijn van Oosterhout
kleptog@svana.org
In reply to: Chris (#2)
Re: Log Slow Queries

On Tue, Apr 04, 2006 at 12:25:09PM +1000, Chris wrote:

MaRCeLO PeReiRA wrote:

Hi Guys,

Is there a feature in PostgreSQL like
"--log-slow-queries"(MySQL) ???

Unfortunately not.

What you can do is edit your postgresql.conf file and set:

log_min_duration_statement

You can also set it per connection:

test=# set log_min_duration_statement =1;
SET

If you only want it some times but not others.
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.