摘要: 写SQL语句时应该避免在索引列上做计算,能移到另一方的都移动到另一方。下面是测试的例子,索引列为D_DATE 1 SQL> select count(1) 2 2 from tywtx a 3 3 where a.d_date >= to_date('20100312', 'yyyymmdd') 4 4 and a.d_date < to_date('20100312', 'yyyymmdd') + 1 5 5 ; 6 7 COUNT(1) 8 ---------- 9 5910 11 Executed in 0 阅读全文
posted @ 2013-05-04 10:32 原想 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 下面是三个语句的测试结果,测试表的数据为25341223行(千万级)SQL> alter system flush shared_pool;System alteredExecuted in 0.047 secondsSQL> select count(1) from thqlog;COUNT(1)----------25341223Executed in 12.297 secondsSQL> alter system flush shared_pool;System alteredExecuted in 0.062 secondsSQL> select count(* 阅读全文
posted @ 2013-05-04 09:48 原想 阅读(426) 评论(0) 推荐(0) 编辑