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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -