php - Why is this MySQL select query slowing things down? -
i have query:
"select * forum_posts post_deleted='0'" i can see via new relic it's eating 60% of mysql resources, , therefore slowing down entire website.
i have no idea why such simple query slow down? table innodb table, index on "id".
- create index on
post_deleted - verify
post_deletedof type boolean (tinyint, smallint, or integer outperform string) - don't compare against string '0' against number 0.
Comments
Post a Comment