Do not attempt to clean the same segment multiple times.
[cumulus.git] / schema.sql
index 8529e32..850e6a9 100644 (file)
@@ -19,7 +19,8 @@ create table segments (
     path text,
     checksum text,
     mtime real,
-    size integer
+    size integer,
+    expire_time integer         -- snapshotid of latest snapshot when expired
 );
 
 -- Index of all blocks which have been stored, by checksum.
@@ -46,8 +47,8 @@ create unique index segments_used_index
 
 -- 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
+select segmentid, mtime, size, expire_time,
+       cast(size * utilization as integer) as used, utilization
 from segments join
      (select segmentid, max(utilization) as utilization
       from segments_used group by segmentid)