Created
March 11, 2020 00:43
-
-
Save den-crane/e43f8d0ad6f67ab9ffd09ea3e63d98aa to your computer and use it in GitHub Desktop.
NullableVsInt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Denny Crane [not a Yandex bot], [Mar 10, 2020 at 6:34:43 PM (2020-03-10, 6:34:50 PM)]: | |
create table XXN (A Int64, B Nullable(Int64)) Engine=MergeTree order by tuple() | |
insert into XXN select 45545645, null from numbers(100000000); | |
select column, formatReadableSize(sum(column_bytes_on_disk)) bytes_on_disk, formatReadableSize(sum(column_data_uncompressed_bytes)) uncompressed | |
from system.parts_columns | |
where active = 1 and table like '%XXN%' | |
group by database,table, column | |
┌─column─┬─bytes_on_disk─┬─uncompressed─┐ | |
│ A │ 3.76 MiB │ 762.94 MiB │ | |
│ B │ 4.38 MiB │ 858.31 MiB │ | |
└────────┴───────────────┴──────────────┘ | |
select count(), A from XXN group by A | |
┌───count()─┬────────A─┐ | |
│ 100000000 │ 45545645 │ | |
└───────────┴──────────┘ | |
1 rows in set. Elapsed: 0.039 sec. Processed 100.00 million rows, 800.00 MB (2.56 billion rows/s., 20.49 GB/s.) | |
select count(), B from XXN group by B | |
┌───count()─┬────B─┐ | |
│ 100000000 │ ᴺᵁᴸᴸ │ | |
└───────────┴──────┘ | |
1 rows in set. Elapsed: 0.096 sec. Processed 100.00 million rows, 900.00 MB (1.04 billion rows/s., 9.39 GB/s.) | |
3.5M Mar 10 21:43 A.bin | |
286K Mar 10 21:43 A.mrk2 | |
3.4M Mar 10 21:43 B.bin | |
286K Mar 10 21:43 B.mrk2 | |
434K Mar 10 21:43 B.null.bin | |
286K Mar 10 21:43 B.null.mrk2 | |
303 Mar 10 21:43 checksums.txt | |
67 Mar 10 21:43 columns.txt | |
8 Mar 10 21:43 count.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment