Duplicate buckets in event_statements_histogram_by_digest
Posted by:
Matt Nolf
Date: November 26, 2024 12:19PM
Hi,
I am hoping to use the event_statements_histogram_by_digest table to extract histogram data about my queries - so that I can calculate quantiles (above what is available in event_statements_summary).
However when I look at the buckets, for a few digests there are actually 900 buckets. Two sets of 0->449. One set contains data, while the other has 0 for COUNT and COUNT_BUCKET_AND_LOWER.
Furthermore, I get inconsistent results when querying the table. When I search for a specific schema_name AND digest AND bucket_number I get 1 row, however if I use a range on the bucket_number >= x AND range < x+1 I get 2 rows - one with data, the other 0 values.
For example:
mysql> SELECT * FROM events_statements_histogram_by_digest WHERE SCHEMA_NAME = 'X' AND DIGEST = 'Y' AND BUCKET_NUMBER >= 449 AND BUCKET_NUMBER < 500;
+------------------+------------------------------------------------------------------+---------------+------------------+----------------------+--------------+------------------------+-----------------+
| SCHEMA_NAME | DIGEST | BUCKET_NUMBER | BUCKET_TIMER_LOW | BUCKET_TIMER_HIGH | COUNT_BUCKET | COUNT_BUCKET_AND_LOWER | BUCKET_QUANTILE |
+------------------+------------------------------------------------------------------+---------------+------------------+----------------------+--------------+------------------------+-----------------+
| X | Y | 449 | 9120108393559408 | 18446744073709551615 | 0 | 18930820 | 1.000000 |
| X | Y | 449 | 9120108393559408 | 18446744073709551615 | 0 | 0 | 0.000000 |
+------------------+------------------------------------------------------------------+---------------+------------------+----------------------+--------------+------------------------+-----------------+
2 rows in set (0.26 sec)
mysql> SELECT * FROM events_statements_histogram_by_digest WHERE SCHEMA_NAME = 'X' AND DIGEST = 'Y' AND BUCKET_NUMBER = 449;
+------------------+------------------------------------------------------------------+---------------+------------------+----------------------+--------------+------------------------+-----------------+
| SCHEMA_NAME | DIGEST | BUCKET_NUMBER | BUCKET_TIMER_LOW | BUCKET_TIMER_HIGH | COUNT_BUCKET | COUNT_BUCKET_AND_LOWER | BUCKET_QUANTILE |
+------------------+------------------------------------------------------------------+---------------+------------------+----------------------+--------------+------------------------+-----------------+
| X | Y | 449 | 9120108393559408 | 18446744073709551615 | 0 | 18930820 | 1.000000 |
+------------------+------------------------------------------------------------------+---------------+------------------+----------------------+--------------+------------------------+-----------------+
1 row in set (0.12 sec)
Why is this? And how can I reliably query this table to collect all buckets for a given query.
Subject
Views
Written By
Posted
Duplicate buckets in event_statements_histogram_by_digest
48
November 26, 2024 12:19PM
Sorry, only registered users may post in this forum.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.