中国开发网: 论坛: 程序员情感CBD: 贴子 620792
Apache
【技术贴】 SQL 语句优化
现在有这样两个表(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条左右,查询非常慢,各位大牛有没有什么办法优化以上语句,加快查询速度,恳请各位大牛指点迷津











相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录