Track which objects are used in which snapshots in the local database.
[cumulus.git] / schema.sql
index 114670c..8518c4f 100644 (file)
@@ -3,7 +3,7 @@
 --
 -- The index is stored in an SQLite3 database.  This is its schema.
 
--- Index of all blocks which have been stored in one snapshot, by checksum.
+-- Index of all blocks which have been stored in a snapshot, by checksum.
 create table block_index (
     blockid integer primary key,
     segment text,
@@ -12,3 +12,10 @@ create table block_index (
     size integer
 );
 create index block_content_index on block_index(checksum);
+create index block_name_index on block_index(segment, object);
+
+-- Index tracking which blocks are used by which snapshots.
+create table snapshot_contents (
+    blockid integer,
+    snapshot text
+);