delete A a where not exists (select 1 from B d
     where a.id_no=d.id_no and d.use_number =1)怎么让它执行的效率提高阿????
A表和B表都很大,大概都4千万的样子,A,B的ID_NO 都有索引,上面执行花了四个小时还是没跑出来...请教了........

解决方案 »

  1.   

    那请教下这条语句的意思,我没怎么看懂.我不会exists 的语法
      

  2.   

     整个语句的意思:
    从A表中删除记录,条件是id_no在B表中不存在并且B表的number=1的记录not exists表示在B表中不存在的id_no
      

  3.   

    To flush DB buffer cache (DB blocks):
    10g
    alter system flush buffer_cache;
    9i
    alter session set events = 'immediate trace name flush_cache';To flush shared pool (parsed SQls/PL/SQLs:alter system flush shared_pool;