sql 语句执行效率问题
--比较下面两段sql 执行效率
select * from DC_Keyword where nick='绿鸽鞋类专营店' and campaign_id=6852747
and adgroup_id=160206338 and keyword_id is not null and data_time in
(select MAX(data_time) from DC_Keyword where nick='绿鸽鞋类专营店')
--特别是当用到子查询的时候,在子查询语句中 where 条件尽可能多 查询效率越快
select * from DC_Keyword where nick='绿鸽鞋类专营店' and campaign_id=6852747
and adgroup_id=160206338 and keyword_id is not null and data_time in
(select MAX(data_time) from DC_Keyword where nick='绿鸽鞋类专营店' and campaign_id=6852747
and adgroup_id=160206338)

浙公网安备 33010602011771号