In order to check the query execution log in to the admin console and click menu manager. Then the query triggers. To check how the PR works, first apply the PR via the Joomla! Patch Tester and then log in to the admin console and click menu manager.
Original Query before the Optimization
SELECT a.*FROM#_menu_types AS aGROUP BYa.id, a.menutype, a.title, a.descriptionORDER BYa.idasc
After the Optimization
SELECTa.id, a.menutype, a.title, a.descriptionFROM#_menu_types AS aWHEREa.id>0ORDER BYa.idasc
Query Change Description
In this query group by clause has been removed. Also removed the SELECT a.* and instead added the corresponding fields to the select clause. Also added the WHERE clause in order to be able to use the PRIMARY KEY as the index.
I don't think that adding WHERE a.id > 0 brings anything in terms of performance. The ORDER BY clause will automatically trigger the use of the right (primary) index imho.
@test
Before Patch: Query Time: 30.61 ms After last query: 165.09 ms Query memory: 0.012 MB Memory before query: 1.154 MB
After Patch: Query Time: 0.37 ms After last query: 0.39 ms Query memory: 0.011 MB Memory before query: 1.168 MB
We have several successfull tests and no negative ones. Setting this one to RTC. @beat Your concern might be valid, but it also has not negative impact, so I wouldn't stop this PR from being merged.
Related Tracker http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=34072