Continuing the discussion from How to find the size of single row in crate db:
Thanks for the answer @proddata:
select
schema_name,
table_name,
sum(num_docs) nb_records,
SUM(size) table_size_bytes,
sum(size) / sum(num_docs)::DOUBLE as avg_size_in_bytes
from sys.shards
where primary and table_name = '<table_name>'
group by 1,2 limit 100;
I have been deleting the records from the table, and the nb_records is effectively reduced. The problem is that table_size_bytes
is not being reduced, and as result avg_size_in_bytes
increases.
I tried REFRESH TABLE "doc"."table_name" ;
but it did not help.
Can someone help or provide more information on how to refresh or force refreshing to get the latest statistics ?