diff --git a/src/Dibi/Bridges/Tracy/Panel.php b/src/Dibi/Bridges/Tracy/Panel.php
index 0c59bbd1c..cf79738d8 100644
--- a/src/Dibi/Bridges/Tracy/Panel.php
+++ b/src/Dibi/Bridges/Tracy/Panel.php
@@ -105,7 +105,16 @@ public function getPanel(): ?string
}
$totalTime = $s = null;
- foreach ($this->events as $event) {
+ $occurrences = [];
+
+ foreach ($this->events as $key => $event) {
+ $hashSql = md5(preg_replace('/[^[:alnum:]]/u', '', $event->sql));
+ $hashes[$key] = $hashSql;
+ $occurrences[$hashSql] = (isset($occurrences[$hashSql]) ? ++$occurrences[$hashSql] : 1);
+ }
+
+ foreach ($this->events as $key => $event) {
+ $hashSql = $hashes[$key];
$totalTime += $event->time;
$connection = $event->connection;
$explain = null; // EXPLAIN is called here to work SELECT FOUND_ROWS()
@@ -126,7 +135,9 @@ public function getPanel(): ?string
$counter++;
$s .= "
explain";
}
-
+ if ($occurrences[$hashSql] > 1) {
+ $s .= '
Occurs:' . $occurrences[$hashSql] .'x
'; + } $s .= '