[阅读: 428] 2008-04-15 04:42:56
现在有这样两个表(ORACLE)
inforcontent(内容表)
.inforId
.editState
tblInforDotLog(日志表,保存点击的记录)
.inforContentId
.operator
需要进行一个关联查询,实现找出某个用户没有点击过的内容,用如下的语句
select inforcontent.* from inforcontent where inforcontent.editState='5'
and not exists
( select distinct tblInforDotLog.inforContentId from TblInforDotLog tblInforDotLog where inforcontent.inforId = tblInforDotLog.inforContentId and tblInforDotLog.operator ='abc')
现在 tblInforDotLog 的数据量很大,大概有500W条左右,查询非常慢,各位大牛有没有什么办法优化以上语句,加快查询速度,恳请各位大牛指点迷津