This perl script shows hogs.  Call like this:

  ./p6spylogtophogs.pl < spy.log  > hog_report.txt

<pre>
#!/usr/bin/perl -w
use strict;

use Digest::MD5 qw(md5 md5_hex md5_base64);

my %hogs;
my %hogtime;
my %hogcount;

# read the data
while (<>) {
  chomp;
  my($ct,$et,$cat,$num,$stmt,$prep)=split(/\|/);
  my $key=md5_base64($stmt);

  $hogtime{$key} += $et;
  $hogcount{$key}++;
  $hogs{$key}=$stmt;
}

# output the hogs

print "Total Time\tQueries\tStatement\n";
print "----------\t-------\t---------\n";

my $key;
foreach $key (sort by_value keys %hogtime) {
  print "$hogtime{$key}\t\t$hogcount{$key}\t$hogs{$key}\n";
}
sub by_value { $hogtime{$b} <=> $hogtime{$a}; }
</pre>

--Dave