sql:select xxx from a where id in(select id from b where t =100) and time =xxx
形如以上的SQL可以做怎样的优化,目前a表为数据表,b表为模板表,where id in的表示为了适应业务上的灵活变化。现在这个sql测试执行时间为几秒,会比数据库慢一些,能有什么好的SQL或者性能优化办法嘛
sql:select xxx from a where id in(select id from b where t =100) and time =xxx
形如以上的SQL可以做怎样的优化,目前a表为数据表,b表为模板表,where id in的表示为了适应业务上的灵活变化。现在这个sql测试执行时间为几秒,会比数据库慢一些,能有什么好的SQL或者性能优化办法嘛
不要in 把in改为join