如下为在PL/SQL中的测试结果一个查询语句
select * from web_data where devicecode=211011648
执行的时间是0.078s,
而加了排序之后
select * from web_data where devicecode=211011648 order by dataid asc
执行的时间是6.329s其中dataid是主键,devicecode与dataid都是number类型,且在这两个字段上都加了索引整个web_data表的记录数是1640542,
满足条件devicecode=211011648的记录数是5443,请教高人指点如何才能提升排序的性能?
select * from web_data where devicecode=211011648
执行的时间是0.078s,
而加了排序之后
select * from web_data where devicecode=211011648 order by dataid asc
执行的时间是6.329s其中dataid是主键,devicecode与dataid都是number类型,且在这两个字段上都加了索引整个web_data表的记录数是1640542,
满足条件devicecode=211011648的记录数是5443,请教高人指点如何才能提升排序的性能?
解决方案 »
- 为什么这个语句会提示不是GROUP BY 表达式
- tnsnames.ora文件被锁定了
- 两个表中的编码比对
- 请问可以用SQL来查询到当前Session的事务状态吗?
- 能不能用PL/SQL写一个存储过程将本用户下的数据备份成一个文件?怎么能做到!
- 想学PL/SQL。。!!!!!!!!!!
- 请教一个SQL统计语句
- Oracle8i在unix下持续13天占CPU 70%,影响应用系统访问速度,请大家出招帮忙解决
- 请教:在.net环境下 有没有像jdbc那样的方便的连接oracle的办法?难道非得装oracleClient??
- 怎样为我的ORACLE数据库创建一个用户?
- ora-01017 invalid username/password;logon denied
- update语句执行计划有问题
内存中有个排序区, sort_area_size 调调试试
select * from(select * from web_data where devicecode=211011648 ) order by dataid asc或者修改建在dataid上的索引,指定按照升序。