We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alter table z materialize projection builds a projection with the size is much bigger than the size after insertion or merge.
alter table z materialize projection
create table z(pk Int64, d Date, id UInt64, c UInt64) Engine=MergeTree partition by d order by pk; insert into z select number, today(), intDiv (number, 1000000), 1 from numbers(100000000); optimize table z final; alter table z add projection pp (select id, sum(c) group by id); alter table z materialize projection pp settings mutations_sync=1; insert into z select number, today()+1, intDiv (number, 1000000), 1 from numbers(100000000); SELECT database, table, name, partition, formatReadableSize(sum(data_compressed_bytes) AS size) AS compressed, formatReadableSize(sum(data_uncompressed_bytes) AS usize) AS uncompressed, round(usize / size, 2) AS compr_rate, sum(rows) AS rows, count() AS part_count FROM system.projection_parts WHERE (table = 'z') AND active GROUP BY database, table, name, partition ORDER BY size DESC; ┌─database─┬─table─┬─name─┬─partition──┬─compressed─┬─uncompressed─┬─compr_rate─┬─rows─┬─part_count─┐ │ dw │ z │ pp │ 2021-11-23 │ 2.22 KiB │ 28.80 KiB │ 12.97 │ 1843 │ 1 │ 1843 rows after materialize │ dw │ z │ pp │ 2021-11-24 │ 820.00 B │ 1.63 KiB │ 2.03 │ 104 │ 5 │ 104 rows after insert └──────────┴───────┴──────┴────────────┴────────────┴──────────────┴────────────┴──────┴────────────┘ optimize table z final; ┌─database─┬─table─┬─name─┬─partition──┬─compressed─┬─uncompressed─┬─compr_rate─┬─rows─┬─part_count─┐ │ dw │ z │ pp │ 2021-11-23 │ 475.00 B │ 1.56 KiB │ 3.37 │ 100 │ 1 │ │ dw │ z │ pp │ 2021-11-24 │ 475.00 B │ 1.56 KiB │ 3.37 │ 100 │ 1 │ └──────────┴───────┴──────┴────────────┴────────────┴──────────────┴────────────┴──────┴────────────┘
The text was updated successfully, but these errors were encountered:
amosbird
Successfully merging a pull request may close this issue.
alter table z materialize projection
builds a projection with the size is much bigger than the size after insertion or merge.The text was updated successfully, but these errors were encountered: