+create unique index block_name_index on block_index(segmentid, object);
+
+-- Summary of segment utilization for each snapshots.
+create table segments_used (
+ snapshotid integer not null,
+ segmentid integer not null,
+ utilization real
+);
+
+-- Overall estimate of segment utilization, for all snapshots combined.
+create view segment_info as
+select segmentid, mtime, size, cast(size * utilization as integer) as used,
+ utilization
+from segments join
+ (select segmentid, max(utilization) as utilization
+ from segments_used group by segmentid)
+using (segmentid);