|
我的老帖子
http://www.itpub.net/forum.php?m ... &highlight=cube
最新在postgresql上的比较
也是没有优化cube生成
pop=# select count(*) from ren group by c1;
count
----------
9996826
10003174
(2 行记录)
pop=# \timing
启用计时功能.
pop=# create table test_cube1 as select c1,c2,c3,c4,c5,c6,count(*)cnt from ren group by cube(c1,c2,c3,c4,c5,c6);
SELECT 13616133
时间:514886.073 ms (08:34.886)
pop=# create table test_cube12 as select c1,c2,count(*)cnt from ren group by cube(c1,c2);
SELECT 12
时间:10644.760 ms (00:10.645)
pop=# create table test_cube12_man as select c1,c2,count(*)cnt from ren group by c1,c2
pop-# union all select c1,null,count(*)from ren group by c1
pop-# union all select null,c2,count(*)from ren group by c2
pop-# union all select null,null,count(*)from ren;
SELECT 12
时间:6798.374 ms (00:06.798)
|
|