Track which objects are used in which snapshots in the local database.
[cumulus.git] / schema.sql
1 -- We maintain a local index of data blocks that have been previously stored
2 -- for constructing incremental snapshots.
3 --
4 -- The index is stored in an SQLite3 database.  This is its schema.
5
6 -- Index of all blocks which have been stored in a snapshot, by checksum.
7 create table block_index (
8     blockid integer primary key,
9     segment text,
10     object text,
11     checksum text,
12     size integer
13 );
14 create index block_content_index on block_index(checksum);
15 create index block_name_index on block_index(segment, object);
16
17 -- Index tracking which blocks are used by which snapshots.
18 create table snapshot_contents (
19     blockid integer,
20     snapshot text
21 );