sql - MySQL not in very slow -


i hope can me. sql query:

select *  pf_profilvisit  u1 = '".$user."'     , u2 not in (       select empf pf_mailbox abs = '".$user."'    )     , u2 not in (       select abs pf_mailbox empf = '".$user."'    )  order id desc); 

how can make faster?

select pf_profilvisit.*  pf_profilvisit left join  pf_mailbox  on pf_profilvisit.u2 = pf_mailbox.empf    or pf_profilvisit.u2 = pf_mailbox.abs pf_profilvisit.u1 = '".$user."'    , pf_mailbox.empf null   , pf_mailbox.abs null order pf_profilvisit.id desc; 

could show tables schema? have columns pf_mailbo.abs, pf_mailbo.empf, pf_profilvisit .u1, pf_profilvisit.u2, pf_profilvisit.id indexed ?


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -