SQl 优化的方式:
explain select vend_id,prod_id,prod_price
from products
where prod_price<=5
Union
select vend_id,prod_id,prod_price
from products
where vend_id in(1001,1002);
1 PRIMARY products ALL 14 33.33 Using where
2 UNION products ALL fk_products_vendors 14 35.71 Using where
UNION RESULT <union1,2> ALL Using temporary
SQL查询优化实践
1684

被折叠的 条评论
为什么被折叠?



