php - Query takes too much time to execute -


i have issue query take time execute. query

select u.user_id, c.c_id, u.username, u.email, r.reply users u, conversation c, conversation_reply r case  when c.user_one =1 c.user_two = u.user_id when c.user_two =1 c.user_one = u.user_id end  , c.c_id = r.c_id_fk , ( c.user_one =1 or c.user_two =1 ) order c.c_id desc 

i have 250788 total recoderds in conversation_reply table store message details query give 10225 records in result , take 7.291 sec.

please give me proper solution.

you can tell database forcefully use index. below

use index (index1,index2) 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -