LP #1265546: wrong statistics for query type
Description
Environment
Smart Checklist
Activity

lpjirasync January 24, 2018 at 8:02 PM
**Comment from Launchpad by: Launchpad Janitor on: 17-11-2014 04:17:17
[Expired for Percona Toolkit because there has been no activity for 60 days.]

lpjirasync January 24, 2018 at 8:02 PM
**Comment from Launchpad by: Muhammad Irfan on: 04-09-2014 08:04:17
I can't reproduce it.
$ pt-query-digest --version
pt-query-digest 2.2.10
$ awk '{for (i=1;i<=NF;i+) if ( $i == "INSERT") c+}END {print c}' /var/lib/mysql/centos1-slow.log
105
$ cat /var/lib/mysql/centos1-slow.log
Profile
Rank Query ID Response time Calls R/Call V/M Item
==== ================== ============= ===== ====== ===== ==========
1 0xCAEC22E79B0EFD3B 1.8842 97.5% 105 0.0179 0.00 INSERT t?
MISC 0xMISC 0.0488 2.5% 21 0.0023 0.0 <10 ITEMS>
Query 1: 52.50 QPS, 0.94x concurrency, ID 0xCAEC22E79B0EFD3B at byte 40611
This item is included in the report because it matches --limit.
Scores: V/M = 0.00
Time range: 2014-09-04 02:50:04 to 02:50:06
Attribute pct total min max avg 95% stddev median
============ === ======= ======= ======= ======= ======= ======= =======
Count 83 105
Exec time 97 2s 13ms 32ms 18ms 28ms 4ms 16ms
Lock time 9 2ms 12us 51us 17us 27us 5us 15us
Count total 105 reflects total 105 inserts correctly. What pt-query-digest version you used ? Can you attach your slow query log file to check with it.
Details
Assignee
UnassignedUnassignedReporter
lpjirasynclpjirasync(Deactivated)Priority
LowLabels
Details
Details
Assignee
Reporter

Priority
Labels
Smart Checklist
Open Smart Checklist
Smart Checklist
Open Smart Checklist
Smart Checklist

**Reported in Launchpad by Aleksandr Kuzminsky last update 17-11-2014 04:17:20
There are two types of queries in a slow log:
1. SELECT /*!40001 SQL_NO_CACHE */ * FROM <table> (2 queries)
2. INSERT INTO <table> (4k queries)
Nevertheless pt-query-digest reports this statistics:
Attribute pct total min max avg 95% stddev median
============ === ======= ======= ======= ======= ======= ======= =======
Count 0 751
Exec time 20 198s 44us 29s 264ms 501ms 2s 84us
Lock time 0 20ms 16us 140us 26us 42us 8us 22us
Rows sent 48 31.81M 0 10.79M 43.38k 59.57k 467.31k 9.83
Rows examine 13 31.81M 0 10.79M 43.38k 59.57k 467.31k 9.83
Query size 0 43.21k 45 79 58.92 69.19 6.27 56.92
String:
Databases <db1> (173/23%), <db2> (98/13%)... 32 more
Hosts localhost
Users <user>
Query_time distribution
1us
10us ################################################################
100us ####################
1ms ##########
10ms ###########
100ms #########
1s ###
10s+ #
Count 751 neither corresponds to SELECT nor to INSERT.