mariadb-query-digest for MariaDB Tools

Overview

The mariadb-query-digest utility.

mariadb-query-digest Options for MariaDB Tools

Option

Argument

Description

--ask-pass

Prompt for a password when connecting to MariaDB

--attribute-aliases

string

List of attribute|alias,etc (default db|Schema)

--attribute-value-limit

integer

A sanity limit for attribute values (default 0)

--charset (-A)

string

Default character set

--config

string

Read this comma-separated list of config files; if specified, this must be the first option on the command line

--continue-on-error

Continue parsing even if there is an error ( default yes). Disable using: --nocontinue-on-error

--create-history-table

Create the --history table if it does not exist ( default yes). Disable using: --nocreate-history-table

--create-review-table

Create the --review table if it does not exist ( default yes). Disable using: --nocreate-review-table

--daemonize

Fork to the background and detach from the shell

--database (-D)

string

Connect to this database

--defaults-file (-F)

string

Only read mariadb options from the given file

--embedded-attributes

string

Two Perl regex patterns to capture pseudo- attributes embedded in queries

--expected-range

string

Explain items when there are more or fewer than expected (default 5,10)

--explain

DSN

Run EXPLAIN for the sample query with this DSN and print results

--filter

string

Discard events for which this Perl code doesn't return true

--group-by

string

Which attribute of the events to group by ( default fingerprint)

--help

Show help and exit

--history

DSN

Save metrics for each query class in the given table. mariadb-query-digest saves query metrics ( query time, lock time, etc.) to this table so you can see how query classes change over time

--host (-h)

string

Connect to host

--ignore-attributes

string

Do not aggregate these attributes (default arg, cmd, insert_id, ip, port, Thread_id, timestamp, exptime, flags, key, res, val, server_id, offset, end_log_pos, Xid)

--inherit-attributes

string

If missing, inherit these attributes from the last event that had them (default db,ts)

--interval

float

How frequently to poll the processlist, in seconds (default .1)

--iterations

integer

How many times to iterate through the collect- and-report cycle (default 1)

--limit

string

Limit output to the given percentage or count ( default 95%:20)

--log

string

Print all output to this file when daemonized

--max-hostname-length

integer

Trim host names in reports to this length. 0=Do not trim host names (default 10)

--max-line-length

integer

Trim lines to this length. 0=Do not trim lines ( default 74)

--order-by

string

Sort events by this attribute and aggregate function (default Query_time:sum)

--outliers

string

Report outliers by attribute:percentile:count ( default Query_time:1:10)

--output

string

How to format and print the query analysis results (default report)

--password (-p)

string

Password to use when connecting

--pid

string

Create the given PID file

--port (-P)

integer

Port number to use for connection

--preserve-embedded-numbers

Preserve numbers in database/table names when fingerprinting queries

--processlist

DSN

Poll this DSN's processlist for queries, with -- interval sleep between

--progress

string

Print progress reports to STDERR (default time, 30)

--read-timeout

time

Wait this long for an event from the input; 0 to wait forever (default 0). Optional suffix s= seconds, m=minutes, h=hours, d=days; if no suffix, s is used.

--report

Print query analysis reports for each --group-by attribute (default yes). Disable using: --noreport

--report-all

Report all queries, even ones that have been reviewed

--report-format

string

Print these sections of the query analysis report (default rusage,date,hostname,files, header,profile,query_report,prepared)

--report-histogram

string

Chart the distribution of this attribute's values (default Query_time)

--resume

string

If specified, the tool writes the last file offset, if there is one, to the given filename

--review

DSN

Save query classes for later review, and don't report already reviewed classes

--run-time

time

How long to run for each --iterations. Optional suffix s=seconds, m=minutes, h=hours, d=days; if no suffix, s is used.

--run-time-mode

string

Set what the value of --run-time operates on ( default clock)

--sample

integer

Filter out all but the first N occurrences of each query

--set-vars

string

Set the MariaDB variables in this comma- separated list of variable=value pairs

--show-all

string

Show all values for these attributes

--since

string

Parse only queries newer than this value (parse queries since this date)

--slave-password

string

Sets the password to be used to connect to the slaves

--slave-user

string

Sets the user to be used to connect to the slaves

--socket (-S)

string

Socket file to use for connection

--timeline

Show a timeline of events

--type

string

The type of input to parse (default slowlog)

--until

string

Parse only queries older than this value (parse queries until this date)

--user (-u)

string

User for login if not current user

--variations

string

Report the number of variations in these attributes' values

--version

Show version and exit

--vertical-format

Output a trailing "\G" in the reported SQL queries (default yes). Disable using: --novertical-format

--watch-server

string

This option tells mariadb-query-digest which server IP address and port (like "10.0.0.1: 3306") to watch when parsing tcpdump (for --type tcpdump); all other servers are ignored