taxonomy - SQL overload - weird query -
my hoster claims following sql query overloading server , causing perform , threatens disable account. can't seem find bottleneck - can me detect comes from?
executed 1 min ago 8 sec on database --> mydb_name.
select * tsk_posts left join tsk_term_relationships on (tsk_posts.id = tsk_term_relationships.object_id) left join tsk_term_taxonomy on (tsk_term_relationships.term_taxonomy_id = tsk_term_taxonomy.term_taxonomy_id) tsk_posts.post_status = 'publish' , tsk_posts.post_type = 'post' , tsk_term_taxonomy.taxonomy = 'category' , ( tsk_term_taxonomy.term_id = 4 or tsk_term_taxonomy.term_id = 103 or tsk_term_taxonomy.term_id = 19 or tsk_term_taxonomy.term_id = 20 or tsk_term_taxonomy.term_id = 5 or tsk_term_taxonomy.term_id = 2 or tsk_term_taxonomy.term_id = 14 ) order rand() limit 1
thank much.
"order rand" can quite expensive query. random number must generated , used access result set.
how many rows in each of tables? there indexes? run explain plan better idea cost is.