pt-query-advisor RES.001 is incorrect

Reported by Rob Smith on 2012-05-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit
Low
Brian Fraser

Bug Description

The following query incorrectly triggers RES.001

SELECT cola, MAX(colb) FROM table WHERE cola = 123 GROUP BY cola;

All the aggregate functions I've tested seem to result in the same incorrect RES.001 trigger.

Actually that test case shows a different thing we ought to be catching: if you GROUP BY something that's constrained to be a constant, you should really not GROUP BY it. We might want to create a new rule for that.

In reality, the WHERE is cola IN (123, 456, 789, etc), in which case the group by does make sense. I just simplified it. Glad my oversimplification found another issue to catch :)

tags: added: query-rule
Changed in percona-toolkit:
status: New → Triaged
Brian Fraser (fraserbn) wrote :

The attached branch only fixes the reported bug, but doesn't add the new rule that Baron suggested.

Changed in percona-toolkit:
assignee: nobody → Brian Fraser (fraserbn)
status: Triaged → In Progress
Brian Fraser (fraserbn) on 2012-11-09
Changed in percona-toolkit:
milestone: none → 2.1.7
Changed in percona-toolkit:
milestone: 2.1.7 → 2.1.8
Changed in percona-toolkit:
importance: Undecided → Low
Brian Fraser (fraserbn) on 2012-12-06
Changed in percona-toolkit:
status: In Progress → Fix Committed
summary: - Incorrect RES.001
+ pt-query-advisor RES.001 is incorrect
Changed in percona-toolkit:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers