select trandate, serseqno, acctno, voukind,vouno, memomsg, cdflag, amount, trancode, oppaccno, oppacctname, flag
from glsinacctlist a
where cancelflag='0'
and trancode not in ( '548300', 'T00000' ) and acctno='6217000088103047' and trandate='2017-04-17'
and ( ( (trancode = 'TC0001' or trancode = 'TP0001') and ( flag = '1' or flag = '2' ) ) or (trancode <> 'TC0001' and trancode <> 'TP0001' and flag not in ('B','C','D','E') ) )
and not exists ( select 1 from GLSINACCTLIST where acctno=a.acctno and trandate=a.trandate and cancelstan=a.serseqno and cancelflag='1') order by a.serseqno这条语句在执行时,有的时候很快,有的时候很慢,一执行cpu就飚到100%
表glsinacctlist 中大概有8000万条数据
求大神门给个优化建议,最好能解释下为什么,在下小白啊,下周上线
急急急急!
from glsinacctlist a
where cancelflag='0'
and trancode not in ( '548300', 'T00000' ) and acctno='6217000088103047' and trandate='2017-04-17'
and ( ( (trancode = 'TC0001' or trancode = 'TP0001') and ( flag = '1' or flag = '2' ) ) or (trancode <> 'TC0001' and trancode <> 'TP0001' and flag not in ('B','C','D','E') ) )
and not exists ( select 1 from GLSINACCTLIST where acctno=a.acctno and trandate=a.trandate and cancelstan=a.serseqno and cancelflag='1') order by a.serseqno这条语句在执行时,有的时候很快,有的时候很慢,一执行cpu就飚到100%
表glsinacctlist 中大概有8000万条数据
求大神门给个优化建议,最好能解释下为什么,在下小白啊,下周上线
急急急急!
解决方案 »
- sql*plus 和 pl/sql develop dbms_output.put_line结果输出问题
- frm-40207怎麼就難倒了那麼多人!!!
- oracle报错2111
- 有了解oracle商业智能的朋友嘛?
- oralce连接的一个疑问
- @@@送分快来抢:oracle中一个表的记录ID是用number类型,还是用rowid好?
- 存储过程中的insufficient privileges问题
- 请问双机热备份需要两个licence吗??
- Java实现plsql DBMS_UTILITY的问题
- 求一个表中不同字段中相同数据的个数是多少?
- 下面这个数据库触发器报错,请问是啥问题呢?
- 请教Java处理大批量的数据(大约200G左右数据)
from glsinacctlist a not exists ( select 1 from GLSINACCTLIST where acctno=a.acctno and trandate=a.trandate and cancelstan=a.serseqno and cancelflag='1') 这个连接的意义是什么,不能直接换成cancelflag!='1'么