mysqldumpslow is broken by the more detailed slow log format

Bug #734211 reported by Michael Koziarski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
Won't Fix
Undecided
Unassigned

Bug Description

mysqldumpslow is confused by slow query log in percona-server. This results in every single query being treated individually, preventing the tool from performing aggregate analysis.

For example asking for the top 10 slow queries results in the same query being listed 10 times

# mysqldumpslow -t 10 mysql-slow.log

Reading mysql slow query log from mysql-slow.log
Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), pressthing[pressthing]@localhost
  # Thread_id: N Schema: pressthing_production Last_errno: N Killed: N
  # Query_time: N.N Lock_time: N.N Rows_sent: N Rows_examined: N Rows_affected: N Rows_read: N
  # Bytes_sent: N Tmp_tables: N Tmp_disk_tables: N Tmp_table_sizes: N
  # InnoDB_trx_id: F82E01
  SET timestamp=N;
  SELECT * FROM `delayed_jobs` WHERE ((run_at <= 'S' AND (locked_at IS NULL OR locked_at < 'S') OR (locked_by = 'S')) AND failed_at IS NULL) ORDER BY priority DESC, run_at ASC LIMIT N

Count: 1 Time=0.00s (0s) Lock=0.00s (0s) Rows=0.0 (0), pressthing[pressthing]@localhost
  # Thread_id: N Schema: pressthing_production Last_errno: N Killed: N
  # Query_time: N.N Lock_time: N.N Rows_sent: N Rows_examined: N Rows_affected: N Rows_read: N
  # Bytes_sent: N Tmp_tables: N Tmp_disk_tables: N Tmp_table_sizes: N
  # InnoDB_trx_id: F82365
  SET timestamp=N;
  SELECT * FROM `delayed_jobs` WHERE ((run_at <= 'S' AND (locked_at IS NULL OR locked_at < 'S') OR (locked_by = 'S')) AND failed_at IS NULL) ORDER BY priority DESC, run_at ASC LIMIT N

Revision history for this message
Michael Koziarski (michael-koziarski) wrote :
Revision history for this message
Michael Koziarski (michael-koziarski) wrote :

It's definitely the transaction id if I run:

grep -v InnoDB_trx_id mysql-slow.log | mysqldumpslow -

I get the correct output.

Revision history for this message
Baron Schwartz (baron-xaprb) wrote : Re: [Bug 734211] Re: mysqldumpslow is broken by the more detailed slow log format

Michael, mysqldumpslow is a really old script that has no tests, very
limited functionality, is hard to change, and is obsolete. Please use
mk-query-digest from Maatkit instead. It is high quality and has many
more features. If there are problems with it, it has a comprehensive
test suite and can be fixed with ease. We will almost certainly not
make any changes to mysqldumpslow.

Changed in percona-server:
status: New → Won't Fix
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-2615

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.