Bug #35663 mysqldumpslow doesn't document all sorting options
Submitted: 29 Mar 2008 1:10 Modified: 25 Jun 2009 2:23
Reporter: Ask Hansen (Basic Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.x OS:Any
Assigned to: Jim Winstead CPU Architecture:Any
Tags: Contribution, patch, qc

[29 Mar 2008 1:10] Ask Hansen
Description:
mysqldumpslow has an option to order by count, but it's not documented.

How to repeat:
Look in the code. :-)

Suggested fix:
--- /local/ask/mysql-5.0.60-20080328/scripts/mysqldumpslow.sh~	2008-03-27 23:26:00.000000000 -0700
+++ /local/ask/mysql-5.0.60-20080328/scripts/mysqldumpslow.sh	2008-03-28 18:04:10.000000000 -0700
@@ -20,7 +20,7 @@
     'verbose|v+',# verbose
     'help+',	# write usage info
     'debug|d+',	# debug
-    's=s',	# what to sort by (t, at, l, al, r, ar etc)
+    's=s',	# what to sort by (t, at, l, al, r, ar, c)
     'r!',	# reverse the sort order (largest last instead of first)
     't=i',	# just show the top n queries
     'a!',	# don't abstract all numbers to N and strings to 'S'
@@ -163,7 +163,14 @@
 
   -v           verbose
   -d           debug
-  -s ORDER     what to sort by (t, at, l, al, r, ar etc), 'at' is default
+  -s ORDER     what to sort by (t, at, l, al, r, ar, c), 'at' is default
+                  t: query time  
+                 at: query time average
+                  l: lock time
+                 al: lock time average  
+                  r: rows sent
+                 ar: rows sent average
+                  c: count
   -r           reverse the sort order (largest last instead of first)
   -t NUM       just show the top n queries
   -a           don't abstract all numbers to N and strings to 'S'
[31 Mar 2008 17:36] Valeriy Kravchuk
Thank you for a reasonable feature request and code contributed.
[9 Dec 2008 12:58] James Green
Might want to close this in favour of bug #7414 which is more comprehensive.
[7 May 2009 17:40] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/73600

2887 Jim Winstead	2009-05-07
      Add explanation of the possible -s values for mysqldumpslow. (Bug #35663,
      based on a contribution by Ask Bjørn Hansen)
      modified:
        scripts/mysqldumpslow.sh
[13 May 2009 16:09] Jim Winstead
Patch queued to 5.1-bugteam, will be merged up from there.
[28 May 2009 8:17] Bugs System
Pushed into 5.1.36 (revid:joro@sun.com-20090528073639-yohsb4q1jzg7ycws) (version source revid:jimw@mysql.com-20090512212719-mjc8fz4q3ewvr4yd) (merge vers: 5.1.35) (pib:6)
[29 May 2009 1:22] Paul DuBois
Cosmetic change. No changelog entry needed.

Setting report to NDI pending push into 6.0.x.
[10 Jun 2009 23:20] Liz Drachnik
Hello - 

In order for us to continue the process of reviewing your contribution to MySQL - We need you to review and sign the Sun|MySQL contributor agreement (the "SCA")

The process is explained here: 
http://forge.mysql.com/wiki/Sun_Contributor_Agreement

Getting a signed/approved SCA on file will help us facilitate your contribution-- this one, and others in the future.

Thank you ! 

Liz Drachnik  - Program Manager - MySQL
[17 Jun 2009 19:23] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090616183122-chjzbaa30qopdra9) (version source revid:jimw@mysql.com-20090514020104-7u5cqf5cyywa8aks) (merge vers: 6.0.12-alpha) (pib:11)
[25 Jun 2009 2:23] Paul DuBois
Cosmetic change. No changelog entry needed.
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:32] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)