原SQLselect * from A aleft join B b on a.id=b.id
优化SQLselect * from (select aa,bb from A where aa='') aleft join (select aa,bb from B where aa='') b on a.id=b.id
或使用临时表先查,然后再关联。