Analyzer for postgresql.log

From: Antonio Fiol Bonnín <fiol(at)w3ping(dot)com>
To: PostgreSQL General Mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Analyzer for postgresql.log
Date: 2001-12-10 12:37:16
Message-ID: 3C14AC7C.8080807@w3ping.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Attached is a little AWK script that you may find of some use.

It takes as standard input a file with the format of the Postgresql log
(level 2, for PostgreSQL 7.0.3 tested).

On standard output, you get a list of times and a mangled form of every
executed request.

Something like

13;select * from my_table where field=''
15;select * from other_table where id= and test>

All number are removed from requests. Also removed are the contents
between single quotes.

This allows me to sort by request and then either count them or add up
the times. That way I know what I need to optimize.

The script is far from perfect. It just works for me ;-)

Antonio Fiol

Attachment Content-Type Size
postgresanalyzer text/plain 1.7 KB

Browse pgsql-general by date

  From Date Subject
Next Message Tim Nelson 2001-12-10 12:43:25 Handling NULL dates in "copy from" statement
Previous Message Tielman J de Villiers 2001-12-10 11:19:46 Re: Logging/Debugging