MARIADB-DUMPSLOW(1)

πŸ’– MARIADB-DUMPSLOW(1) πŸ’–

okay bestie, welcome to the MariaDB Database System corner of the manual β€” this one's called mariadb-dumpslow and it's literally the girl who reads your slow query log so you don't have to 🫢


✨ NAME ✨

mariadb-dumpslow β€” summarize slow query log files, bestie.

(and yes, plot twist: mariadb-dumpslow is now a symlink to mariadb-dumpslow. she's her own twin. iconic behavior, no notes πŸ’…)


🌸 SYNOPSIS 🌸

mariadb-dumpslow [options] [log_file ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: the MariaDB slow query log is where all the queries that take forever go to be remembered. And mariadb-dumpslow? She parses those slow query log files and prints you a lil summary of what's inside. It's giving detective. It's giving gossip. πŸ”

Normally, mariadb-dumpslow groups together queries that are basically the same except for the actual number and string values in them. She "abstracts" those values into N and 'S' when she shows you the summary output. So like, all the messy specifics get blurred out and you just see the shape of the thing. ✨

The -a and -n options can be used to modify that value abstracting behavior. (translation: if you want the real numbers back, she can do that too.)

Invoke mariadb-dumpslow like this:

shell> mariadb-dumpslow [options] [log_file ...]

mariadb-dumpslow supports the following options. let's get into it πŸ’–


πŸ‘‘ OPTIONS πŸ‘‘

  • --help β€” shows you a help message and then dips. bye bestie πŸ‘‹
  • -a β€” do NOT abstract all numbers to N and strings to 'S'. you want the raw truth, she'll give it to you.
  • --debug, -d β€” run in debug mode. spicy 🌢️
  • -g pattern β€” only consider queries that match the (grep-style) pattern. filter her feed, periodt.
  • -h host_name β€” host name of the MariaDB server, used for the *-slow.log file name. the value can contain a wildcard. the default is * (which means: match all of them, she's not picky πŸŽ€).
  • -i name β€” name of the server instance (if you're using the mariadb.server startup script).
  • -l β€” do NOT subtract lock time from total time. keep it all in, no deductions πŸ’…
  • -n N β€” abstract numbers with at least N digits within names.
  • -r β€” reverse the sort order. plot twist energy πŸ”„
  • -s sort_type β€” how to sort the output. the value of sort_type should be chosen from the following list:
    • t, aa: sort by rows affected or average rows affected
    • l, ae: sort by rows examined or aggregate rows examined
    • l, at: sort by query time or average query time
    • l, al: sort by lock time or average lock time
    • s, as: sort by rows sent or average rows sent
    • c: sort by count
  • -t N β€” display only the first N queries in the output. main character only, the rest can wait πŸ™ˆ
  • --verbose, -v β€” verbose mode. prints more information about what the program does. she's oversharing and honestly? we love that for her πŸ—£οΈ

🌈 Example of usage 🌈

shell> mariadb-dumpslow
Reading mariadb slow query log from /usr/local/mysql/data/mysqld51-apple-slow.log
Count: 1  Time=4.32s (4s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost
 insert into t2 select * from t1
Count: 3  Time=2.53s (7s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost
 insert into t2 select * from t1 limit N
Count: 3  Time=2.13s (6s)  Lock=0.00s (0s)  Rows=0.0 (0), root[root]@localhost
 insert into t1 select * from t1

see how that limit N is sitting there? that's the abstracting at work. she said "no specifics, only vibes." 😭


Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2025 MariaDB Foundation

This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. (version 2 specifically, bestie, don't get cute with it.)

This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/.


πŸ”— SEE ALSO πŸ”—

For more information, please refer to the MariaDB Documentation, available online at https://mariadb.com/docs/


πŸ’œ AUTHOR πŸ’œ

MariaDB Foundation (http://www.mariadb.org/).


okay that's the whole page, you ate that 🫢 go read your slow logs and slay πŸ’…βœ¨

MariaDB 11.8 β€” 5 March 2025 β€” that's the version and the date, mwah, bye bestie πŸ’–πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from