You'll find mysqldumpslow (in the mysql distribution) does all that and
much much more

It's a pity that it's not mentioned in the online documentation
since it's a _very_ useful tool.

Tim.

On Mon, Jun 25, 2001 at 11:59:59PM -0700, Nathanial Hendler wrote:
> I wrote a perl script that will parse slow_queries logs, and output some 
> useful information.  It's kind of hard to explain, but I'll try.  I wanted to 
> see what queries were taking a lot of time, and how often they were 
> happening.  I wrote a perl script that parses the log files, ignores queries 
> that take less than n seconds, and normalizes the queries and reports the 
> info for each queries sorted by query occurance.
> 
> 'normalize' meaning...
> 
> this...
> 
> SELECT * FROM ween WHERE pandy_fackler = 1;
> SELECT * FROM ween WHERE pandy_fackler = 15;
> 
> becomes...
> 
> SELECT * FROM ween WHERE pandy_fackler = XXX;
> 
> this...
> 
> SELECT names FROM things WHERE name LIKE '%wazoo%';
> SELECT names FROM things WHERE name LIKE '%tada%';
> 
> becomes...
> 
> SELECT names FROM things WHERE name LIKE 'XXX';
> 
> This has proven to be a very interesting and useful tool.  You should DL it 
> and try it on your long_queries log file.
> 
> Whoever runs mysql.com should put a copy on the website.  It might just be 
> the greatest thing ever (my program, not the website).
> 
> For more info, and to get a copy, you can get it at:
> http://www.retards.org/mysql/index.php
> 
> I'd like to hear people's thought on it.  I'm the only person to test it so 
> far, so it'd be nice to know that it works for other people.
> 
> Thanks,
> Nathan Hendler
> Tucson, AZ USA
> http://retards.org/
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to