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

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -