what is forum_id?
I’ve noticed I have some queries that are performing slowly:
SELECT t.* FROM bb_topics AS t WHERE t.topic_status = ‘0’ AND t.topic_sticky = ‘2’ ORDER BY t.topic_time DESC LIMIT 30
The index the db is using is forum_stickies which is a composite index of (topic_status, forum_id, topic_sticky, topic_time)
THe problem is since the query thats created doesn’t include forum_id, mysql is not able to utilize the composite index completely and performs an additional filesort which slows the performance of the query.
To fix this, I can either create a new index that doesn’t include the forum_id field OR somehow force the code to include the forum_id conditional in the query. I only have one forum and I only plan on having one forum per a database.
I can hack the code, but I suspect there is a setting somewhere that can fix this issue. Any ideas?
- You must be logged in to reply to this topic.