MySQL Forums
Forum List  »  MyISAM

Re: Mysql group by returns wrong result
Posted by: Rick James
Date: March 10, 2013 07:28PM

> we had intentionally opted for MyISAM engine for some tables for better performance. Changing to InnoDB will hamper performance

That's an old wives tale. There are cases where one engine will outperform the other -- either way.

> SELECT ID
FROM TABLE_NAME
WHERE ID IN (15920,15921)
GROUP BY ID

The GROUP BY is unnecessary, unless ID is not UNIQUE. In that case, this would be more logical:
SELECT DISTINCT ID
FROM TABLE_NAME
WHERE ID IN (15920,15921)

If you want to discuss performance, then please provide the CREATE TABLE and the actual SELECTs. There are many subtle issue that impact performance, especially with respect to INDEXes. See
http://mysql.rjweb.org/doc.php/myisam2innodb

Options: ReplyQuote


Subject
Views
Written By
Posted
3069
March 04, 2013 01:01AM
Re: Mysql group by returns wrong result
1607
March 10, 2013 07:28PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.