+create unique index segments_used_index
+ on segments_used(snapshotid, segmentid);
+
+alter table snapshots add column intent real;
+
+-- Initialize the intent column; set all old snapshots to have intent 1
+-- (intended to be a daily snapshot).
+update snapshots set intent = 1;