Group by
| From: | Philip Thompson | Date: | Wed, 09 Dec 2009 15:52:31 +0000 |
| Subject: | Group by | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-46664@lists.php.net to get a copy of this message | ||
Hi.
In a mysql query, it is recommended that "GROUP BY" fields be indexed? Using EXPLAIN on
one of my queries, I noticed no change between having indexed by GROUP BY field and not indexing it.
Any thoughts would be appreciated.
In this example, should
history_field be indexed...?
SELECT MAX(timestamp) AS max_ts
FROM history
WHERE req_id = 17 AND history_record_id = 35
GROUP BY history_field
Thanks,
~Philip