Mysql optimization

Posted by Jens on Stack Overflow See other posts from Stack Overflow or by Jens
Published on 2010-03-16T08:42:30Z Indexed on 2010/03/16 8:46 UTC
Read the original article Hit count: 181

Filed under:
|

I have this mysql table called comments which looks like this:

commentID parentID type userID date comment

The commentID is set as Primary key, but most of the time I fetch the data using the parentID. How should I set my indexes?

Should I just add an index on parentID and let commentID be the primary key?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about optimization