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_deleted of type boolean (tinyint, smallint, or integer outperform string)
  • don't compare against string '0' against number 0.

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -