只需要根据where condition] 和 db1.table1.field1 = db2.table2.field2
增加索引就可以了

解决方案 »

  1.   

    WHERE的条件的写法也很重要,要注意次序,把整型的,查询结果集最小的排在最前面(根据你的应用)
      

  2.   

    数据量特别大的时候,用下面的方法更有效:
    select t1.field1
    from db1.table1 t1 
    where exists(select * from db2.table2 t2 where t1.field1=t2.field2 and ...) 
      

  3.   

    select * from db2.table2 t2 where t1.field1=t2.field2 and ...) 
    上面这句话不也就是用的join连接吗。
    那与楼主用的方法岂不一样。
    然后再来个select t1.field1 from db1.table1 t1 ,不是更加增添工作量了。初学拙见,不对请多包涵!