pt-query-advisor RES.001 is incorrect

Bug #996069 reported by Rob Smith
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Fix Released
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.

Related branches

Revision history for this message
Baron Schwartz (baron-xaprb) wrote : Re: [Bug 996069] [NEW] Incorrect RES.001

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.

Revision history for this message
Rob Smith (kormoc) wrote : Re: Incorrect RES.001

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
Revision history for this message
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)
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)
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
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-779

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.