解决方案 »
- 简单MySql语句问题 , 请高手帮帮忙 !
- 使用CURRENT_TIMESTAMP作默认值的时候怎么update时不更改时间
- 大家在CentOS里对MySQL用什么可视化管理工具呀
- mysql 数据迁移
- 请教Lost connection to MySQL server at 'reading initial communication packet'
- 求一个Mysql数据库查询的方法实现
- mysql怎么查询可以得到这种结果(高手进来吧!)up有分得了。
- 一个简要的问题?
- 在mysql>下用什么命令倒入.sql文件
- 求助,mysql语句优化,有explain的内容
- 为什么用[\u4e00-\u9fa5]匹配的是非中文?
- 内存使用率
select A.INFO_ID,A.Title,A.MODIFY_DATE
from TB_TEXT A,TB_TEXT_LINK B
where A.INFO_ID=B.INFO_ID and B.COLUMN_ID like '01%' and A.STATUS='1'
order by MODIFY_DATE descB.COLUMN_ID和A.INFO_IDA.加索引
谢谢,我换成了你的语句,速度果然快了!看来select in 本身就慢,很难优化了
反正能不用in就不要用in。
show index from ...
以供分析。
PRIMARY KEY (`info_id`),
UNIQUE KEY `index_id` (`info_id`) USING BTREE
explain select INFO_ID,Title,MODIFY_DATE from TB_TEXT where INFO_ID in (select INFO_ID from TB_TEXT_LINK where COLUMN_ID like '01%') and STATUS='1' order by MODIFY_DATE desc就是sql的执行计划,你贴出来大家相对好分析一点。
Invalid path: 'null.infoId'
2014-10-14 23:20:43,533 ERROR [http-8080-1] (ErrorCounter.java:56) - <AST>:0:0: unexpected end of subtree
2014-10-14 23:20:43,533 ERROR [http-8080-1] (ErrorCounter.java:56) - left-hand operand of a binary operator was null
2014-10-14 23:20:43,534 ERROR [http-8080-1] (ErrorCounter.java:56) - <AST>:0:0: unexpected end of subtree
2014-10-14 23:20:43,540 ERROR [http-8080-1] (ErrorCounter.java:56) - Invalid path: 'null.status'
2014-10-14 23:20:43,541 ERROR [http-8080-1] (ErrorCounter.java:56) - <AST>:0:0: unexpected end of subtree
2014-10-14 23:20:43,541 ERROR [http-8080-1] (ErrorCounter.java:56) - left-hand operand of a binary operator was null
org.springframework.orm.hibernate3.HibernateQueryException: Invalid path: 'null.infoId' [ select count (*) from com.baobaotao.domain.NewsInfo,com.baobaotao.domain.TextLink where NewsInfo.infoId=TextLink.infoId and TextLink.columnId like '01%' and NewsInfo.status=1 ]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'null.infoId' [ select count (*) from com.baobaotao.domain.NewsInfo,com.baobaotao.domain.TextLink where NewsInfo.infoId=TextLink.infoId and TextLink.columnId like '01%' and NewsInfo.status=1 ]