Re: Group by
| From: | host@deweywilliams.com | Date: | Wed, 09 Dec 2009 18:58:49 +0000 |
| Subject: | Re: Group by | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46669@lists.php.net to get a copy of this message | ||
The only SELECT is on MAX('timestamp'). There is really nothing to Group BY in this query.
Dewey
Philip Thompson wrote:
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, shouldhistory_fieldbe indexed...? SELECT MAX(timestamp) ASmax_tsFROMhistoryWHEREreq_id= 17 ANDhistory_record_id= 35 GROUP BYhistory_fieldThanks, ~Philip