MySQL Forums
Forum List  »  Performance

Re: Is this GROUP BY query using an index?
Posted by: Jay Pipes
Date: September 23, 2005 04:33PM

Possibly because you have no primary key on the table? Wouldn't an easier and more efficient setup be like this:

CREATE TABLE Poll (
poll_id SMALLINT UNSIGNED NOT NULL
, answer_id TINYINT UNSIGNED NOT NULL
, votes INT UNSIGNED NOT NULL
, PRIMARY KEY (poll_id, answer_id)
);

Jay Pipes
Community Relations Manager, North America, MySQL Inc.

Got Cluster? http://www.mysql.com/cluster
Personal: http://jpipes.com

Options: ReplyQuote


Subject
Views
Written By
Posted
1876
September 23, 2005 12:55PM
Re: Is this GROUP BY query using an index?
1256
September 23, 2005 04:33PM


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.