sql - Mysql query poorly optimized -


i not expert in sql , need following query. poorly optmized , takes long time execute. possible replace in() join() speed query? how it?

select *    shop_orders   id in (select orders_id                  shop_orders_data                 closed = '1' /*and backorder='0'*/)         , id in (select orders_id                      shop_orders_products                     products_id in (select id                                             shop_products                                            artno = '120000'                                                   or name '%120000%'))  order  created desc  

select so.* shop_orders      join shop_orders_data sod on sod.orders_id = so.id      join (select orders_id               shop_orders_products sop                   join shop_products sp on sp.id = sop.products_id             sp.artno = '120000'                    or sp.name '%120000%') sop on sop.orders_id = so.id    sod.closed = '1' order so.created desc 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -