Mysql optimization
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Mysql optimization
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?
Edit: Would it be bad to have 3 indexes? For example on a forum table which has a categoryID boardID and topicID?
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?
Edit: Would it be bad to have 3 indexes? For example on a forum table which has a categoryID boardID and topicID?
Re: Mysql optimization
Yes, this should be the first step.CarmeloLabadie wrote: ↑02 Jun 2021, 04:04 Should I just add an index on parentID and let commentID be the primary key?
That depend on what queries you perform. If they contain categoryID, boardID and/or topicID in the WHERE clause, then it makes sense to add a multi-column index for the used columns too.CarmeloLabadie wrote: ↑02 Jun 2021, 04:04 Edit: Would it be bad to have 3 indexes? For example on a forum table which has a categoryID boardID and topicID?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,
