joomla/joomla-cms — pull request #4112 by nadeeshaan (2014-08-14 17:45:06+00:00)
Title: Sql optimise admin menu types branch

## Testing Instructions:
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.

![Menu Manager](https://cloud.githubusercontent.com/assets/1329674/3903334/9b212870-22ca-11e4-86d5-29598a04fe46.png)

### Original Query before the Optimization

```sql
SELECT a.*
FROM #_menu_types AS a
GROUP BY a.id, a.menutype, a.title, a.description
ORDER BY a.id asc
```

### After the Optimization

```sql
SELECT a.id, a.menutype, a.title, a.description
FROM #_menu_types AS a
WHERE a.id > 0
ORDER BY a.id asc
```
### 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.