pt-query-digest query_review.first_seen vs. query_review_history.ts_min

122 views
Skip to first unread message

Jacky Shu

unread,
Sep 24, 2012, 9:32:11 AM9/24/12
to percona-d...@googlegroups.com
Hi,

When checking the result of pt-query_digest, I noticed column query_review.first_seen and query_review_history.ts_min always have the same value.
Do they actually have any difference?

Thanks.

Gavin Towey

unread,
Sep 24, 2012, 1:36:34 PM9/24/12
to percona-d...@googlegroups.com
Hi Jacky,

They can have the same value, but not always.  The query_review table keeps unique instances of each query, but the query_review_history can have multiple entries for each query fingerprint.  The fields ts_min and ts_max are the statistics aggregated for that query in that particular duration of time.  I'm not sure what the original author intended with the abbreviation ts_, but I think of it as "time slice" or "time series."  

In the query_review table, there's only one entry per unique query fingerprint, and the values for first_seen and last_seen are updated with the smallest value of ts_min for any record in the history table, and last_seen has the highest value of any ts_max value.

Regards,
Gavin Towey

--
You received this message because you are subscribed to the Google Groups "Percona Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/percona-discussion/-/5ay0J6vzWuIJ.
To post to this group, send email to percona-d...@googlegroups.com.
To unsubscribe from this group, send email to percona-discuss...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/percona-discussion?hl=en.

Jacky Shu

unread,
Sep 25, 2012, 12:32:01 PM9/25/12
to percona-d...@googlegroups.com
Thanks Gavin.
Guess I should have used a query to check whether they have same value!
Gavin Towey

To unsubscribe from this group, send email to percona-discussion+unsub...@googlegroups.com.

Jacky Shu

unread,
Sep 25, 2012, 12:46:18 PM9/25/12
to percona-d...@googlegroups.com
Hi Gavin,
Sorry have to ask you again, what is the meaning of  query_review_history.ts_cnt column?
I thought it was how many times a query ran, but it was wrong.

Thanks

Gavin Towey

unread,
Sep 25, 2012, 1:45:10 PM9/25/12
to percona-d...@googlegroups.com
ts_cnt is indeed the count of instances of that query found in that time interval.  What are you seeing that makes it look like that isn't true for you?

To view this discussion on the web visit https://groups.google.com/d/msg/percona-discussion/-/9sexUz3vU-UJ.

To post to this group, send email to percona-d...@googlegroups.com.
To unsubscribe from this group, send email to percona-discuss...@googlegroups.com.

Jacky Shu

unread,
Sep 25, 2012, 2:30:28 PM9/25/12
to percona-d...@googlegroups.com
Ooops, I forgot the counting was based on " in that time interval". now it started to make sense.

Thanks again.
Thanks
Thanks Gavin.
Gavin Towey

To unsubscribe from this group, send email to percona-discussion+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/percona-discussion?hl=en.
Reply all
Reply to author
Forward
0 new messages