Replies: 7 comments 2 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
MySQL [(none)]> create table t2 (i bigint) storage_format = 'native';
Query OK, 0 rows affected (0.047 sec)
MySQL [(none)]> insert into t2 SELECT number FROM numbers(200000000);
Query OK, 200000000 rows affected (30.621 sec)
MySQL [(none)]> SELECT avg(i) FROM t2 group by i%5;
+-------------+
| avg(i) |
+-------------+
| 99999997.5 |
| 99999998.5 |
| 99999999.5 |
| 100000000.5 |
| 100000001.5 |
+-------------+
5 rows in set (3.126 sec) |
Beta Was this translation helpful? Give feedback.
1 reply
-
MySQL [(none)]> create table t2 (i bigint) storage_format = 'native' compression = 'lz4' ;
Query OK, 0 rows affected (0.041 sec)
MySQL [(none)]> insert into t2 SELECT number FROM numbers(200000000);
Query OK, 200000000 rows affected (30.020 sec)
MySQL [(none)]> SELECT avg(i) FROM t2 group by i%5;
+-------------+
| avg(i) |
+-------------+
| 99999997.5 |
| 99999998.5 |
| 99999999.5 |
| 100000000.5 |
| 100000001.5 |
+-------------+
5 rows in set (1.050 sec) |
Beta Was this translation helpful? Give feedback.
1 reply
-
MySQL [(none)]> create table t2 storage_format = 'native' compression = 'lz4' as SELECT number FROM numbers(200000000);
Query OK, 200000000 rows affected (27.947 sec)
MySQL [(none)]> SELECT avg(number) FROM t2 group by number%5;
+-------------+
| avg(number) |
+-------------+
| 99999997.5 |
| 99999998.5 |
| 99999999.5 |
| 100000000.5 |
| 100000001.5 |
+-------------+
5 rows in set (1.125 sec) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
duckdb has temp table ~ $ duckdb duckdb.db
v0.7.1 b00b93f
Enter ".help" for usage hints.
D .timer on
D create table t as SELECT i FROM range(1,200000000)t(i);
100% ▕████████████████████████████████████████████████████████████▏
Run Time (s): real 5.911 user 10.691025 sys 1.056016
D create temp table temp as SELECT i FROM range(1,200000000)t(i);
100% ▕████████████████████████████████████████████████████████████▏
Run Time (s): real 2.805 user 1.886404 sys 0.830373
D SELECT avg(i) FROM t group by i%5;
┌─────────────┐
│ avg(i) │
│ double │
├─────────────┤
│ 99999998.5 │
│ 99999999.5 │
│ 100000000.5 │
│ 100000001.5 │
│ 100000000.0 │
└─────────────┘
Run Time (s): real 0.930 user 6.738657 sys 0.016429
D SELECT avg(i) FROM temp group by i%5;
┌─────────────┐
│ avg(i) │
│ double │
├─────────────┤
│ 99999998.5 │
│ 99999999.5 │
│ 100000000.5 │
│ 100000001.5 │
│ 100000000.0 │
└─────────────┘
Run Time (s): real 0.888 user 6.600488 sys 0.045822 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Beta Was this translation helpful? Give feedback.
All reactions