FUSE_TIME_TRAVEL_SIZE
Calculates the storage size of historical data (for Time Travel) for tables.
Syntax
-- Calculate historical data size for all tables in all databases
SELECT ...
FROM fuse_time_travel_size();
-- Calculate historical data size for all tables in a specified database
SELECT ...
FROM fuse_time_travel_size('<database_name>');
-- Calculate historical data size for a specified table in a specified database
SELECT ...
FROM fuse_time_travel_size('<database_name>', '<table_name>');
Output
The function returns a result set with the following columns:
Examples
This example calculates the historical data for all tables in the default database:
SELECT * FROM fuse_time_travel_size('default')
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ database_name │ table_name │ is_dropped │ time_travel_size │ latest_snapshot_size │ data_retention_period_in_hours │ error │
├───────────────┼────────────┼────────────┼──────────────────┼──────────────────────┼────────────────────────────────┼──────────────────┤
│ default │ books │ true │ 2810 │ 1490 │ NULL │ NULL │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘