Group queries by shape
A query shape is a statement with its values removed, so WHERE id = 1 and WHERE id = 2 count as one shape. The Shapes tab lists each shape with its count and timings.
How is a shape computed?
Section titled “How is a shape computed?”| Rule | Example |
|---|---|
Literals become ? |
WHERE id = 42 becomes WHERE id = ? |
IN (...) lists collapse |
IN (1, 2, 3) becomes IN (?+) |
| Comments are stripped | |
| Whitespace is collapsed | |
| Case is kept as written | select and SELECT are different shapes |
Each shape also gets a hash: 16 hex digits (FNV-1a, 64 bit). The detail panel shows it as Shape hash.
What does the Shapes tab show?
Section titled “What does the Shapes tab show?”| Column | Meaning |
|---|---|
| Shape | The normalised statement |
| Count | Times it ran |
| Total | Summed duration |
| Avg | Average duration |
| Max | Longest duration |
| N+1 hits | Times it was part of an N+1 group |
Click a column header to sort. The default is Total, descending, which puts the shapes using the most database time first. SQLEye keeps statistics for at most 10,000 shapes.
How do I see every run of a shape?
Section titled “How do I see every run of a shape?”Select an event in the Live tab and choose Filter to this shape. A shape chip appears in the toolbar; Reset filters removes it. See filters.
SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.