Search code examples
mysqlperconamysqlbinlogpt-query-digest

pt-query-digest: what is "Query size"?


I'm using pt-query-digest to analyze mysql binlog. Unfortunately, I can't find any description in pt-query-digest documentation about "Query size" row in the report. I guess, that this characteristics related with query output size, but it's an UPDATE statement, not SELECT.

# Query 2: 235.21 QPS, 52.92x concurrency, ID 0x7ABED476DE0F9BF3 at byte 652451215
# This item is included in the report because it matches --limit.
# Scores: V/M = 29.85
# Time range: 2017-03-30 15:56:22 to 16:30:19
# Attribute    pct   total     min     max     avg     95%  stddev  median
# ============ === ======= ======= ======= ======= ======= ======= =======
# Count          9  479132
# Exec time     45 107792s       0     51s   225ms       0      3s       0
# Query size    28 127.99M     266     283  280.11  271.23    2.44  271.23
# error code     0       0       0       0       0       0       0       0
# String:
# Databases    dbname
# Query_time distribution
#   1us
#  10us
# 100us
#   1ms
#  10ms
# 100ms
#    1s  #################################
#  10s+  ################################################################
# Tables
#    SHOW TABLE STATUS FROM `dbname` LIKE 'tblname'\G
#    SHOW CREATE TABLE `dbname`.`tblname`\G
UPDATE `tblname`
                  SET `field1` = 100,
                      `time` = NOW()
                  WHERE `field2` = 1
                    AND `field3` = 2
                    AND `field4` = 3
                    AND `field5` = 0

What's the purpose of it?


Solution

  • Query size ... is the byte size of your query

    In your case its the byte size of the string

    "UPDATE `tblname`
                      SET `field1` = 100,
                          `time` = NOW()
                      WHERE `field2` = 1
                        AND `field3` = 2
                        AND `field4` = 3
                        AND `field5` = 0"