wrong statistics for query type

Bug #1265546 reported by Aleksandr Kuzminsky
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Expired
Undecided
Unassigned

Bug Description

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.

Tags: rdba
tags: added: rdba
Changed in percona-toolkit:
assignee: nobody → Muhammad Irfan (muhammad-irfan)
Revision history for this message
Muhammad Irfan (muhammad-irfan) wrote :

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.

Changed in percona-toolkit:
assignee: Muhammad Irfan (muhammad-irfan) → nobody
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Percona Toolkit because there has been no activity for 60 days.]

Changed in percona-toolkit:
status: Incomplete → Expired
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-1192

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.