NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
pga_aggregate_target big integer 58M
sys@ORCL> SELECT round(pga_target_for_estimate / 1024 / 1024) est_target_mb,
2 estd_pga_cache_hit_percentage,
3 estd_overalloc_count,
4 pga_target_factor
5 FROM v$pga_target_advice
6 ORDER BY 1;
排序肯定要耗费时间,oracle排序的操作依赖于内存排序(pga_sort_size)和物理磁盘的排序(临时表空间),当然是在内存中排序的时间远远短于物理磁盘的排序。你在不使用order by 的时候oracle避免的排序的操作,肯定比不使用排序的时间短,如果你想缩短这个时间可以采取增加pga_sort_size的大小。这样使得你的操作在内存中进行,这样的速度肯定比较快,但是这个值不得太大,不然造成了太多的内存的浪费。。。
[Quote=引用楼主 lyl744455 的回复:]
数据比较多
当用select * from patriot_comments查询只要0.063秒,
但用select * from patriot_comments order by floor desc要53.063秒,
只用了一个排序就多用了很多时间,
诚请高手赐教
[/Quote]
数据有多少啊?看来楼主只能从电脑配置入手了