pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Cristian Cruz <danielcristian@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Logging just SQL commands in an SQL script format
Date: Thu, 25 Jan 2007 12:56:00 -0200
Message-ID: <48d0cacb0701250656r3af8e26bvf70274a823205e78@mail.gmail.com> (raw)
In-Reply-To: <A3AC4FA47DC0B1458C3E5396E685E63302395C55@SAB-DC1.sab.uiuc.edu>
References: <A3AC4FA47DC0B1458C3E5396E685E63302395C55@SAB-DC1.sab.uiuc.edu>

Look at pgfouine.

It can extract SQL commands from log, and build a xml file to be used
with tsung to generate some load testing.

Kind regards...

On 1/24/07, Campbell, Lance <lance@uiuc.edu> wrote:
>
>
>
>
> I want to log all SQL commands as an executable script file for use in
> performance testing.  Currently there is a lot of information in the log
> that is generated that would not be executable.  Below is an example of what
> I would want to see; which is just the SQL.
>
>
>
> Example of log output:
>
> Select a,b,c from calendar where a=12;
>
> Select a,b,c from calendar where a=13;
>
>
>
> Example:
>
> 1) I would take a snap shot of our production database.
>
> 2) I would then turn on SQL logging.
>
> 3) I would put the copy of the database onto a test server.
>
> 4) After a few days of logging the SQL commands I would copy the file to the
> test server.
>
> 5) I would then have a basic script that would display the start time,
> execute the postgres SQL log (pgsql –d database_name –f sql_log_file_name),
> and then display the end time.
>
>
>
> Now I can test configuration changes and index modifications on real world
> data to see what impact the changes would have.  I just keep reloading the
> database, change the configurations settings, and then execute the script
> again.
>
>
>
> The key is that the SQL log be in a format that can be executed as a
> postgres SQL file.
>
>
>
> How do I do this?
>
>
>
> Thanks,
>
>
>
>
>
>
>
> Lance Campbell
>
> Project Manager/Software Architect
>
> Web Services at Public Affairs
>
> University of Illinois
>
> 217.333.0382
>
> http://webservices.uiuc.edu
>
>


-- 
Daniel Cristian Cruz
Analista de Sistemas
Especialista postgreSQL e Linux
Instrutor Certificado Mandriva



view thread (4+ messages)  latest in thread

Message-ID: <48d0cacb0701250656r3af8e26bvf70274a823205e78@mail.gmail.com>
Permalink:  ../48d0cacb0701250656r3af8e26bvf70274a823205e78@mail.gmail.com/
Also on:    postgresql.org/message-id/48d0cacb0701250656r3af8e26bvf70274a823205e78@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: danielcristian@gmail.com
  Subject: Re: Logging just SQL commands in an SQL script format
  In-Reply-To: <48d0cacb0701250656r3af8e26bvf70274a823205e78@mail.gmail.com>
  References: <A3AC4FA47DC0B1458C3E5396E685E63302395C55@SAB-DC1.sab.uiuc.edu> <48d0cacb0701250656r3af8e26bvf70274a823205e78@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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