select url from uni_xmflsh
where url not in(select url from html)
我的意思是要查询出表uni_xmflsh表url字段不再表url的url字段中不重复的内容,每个表的数据都有几十万,这样下来等待了很久都没有相应,而且cpu一直发烧,有更好的办法实现么??

解决方案 »

  1.   

    select a.url from uni_xmflsh a
    left join html b 
    on a.url=b.url 
    where b.url is null 
    在URL上建立索引
      

  2.   

    select url from html在这个HTML表上建立URL的索引,建索引估计要花不少时间。
      

  3.   

    没有其它好方法了。能提高速度的方法就是在 HTML表上建立URL的索引 以提高 select url from html where url =a.url的访问速度select url from uni_xmflsh
    where not exists (select url from html whre url=uni_xmflsh.url );