1 -- We maintain a local index of data blocks that have been previously stored
2 -- for constructing incremental snapshots.
4 -- The index is stored in an SQLite3 database. This is its schema.
6 -- List of snapshots which have been created.
7 create table snapshots (
8 snapshotid integer primary key,
13 -- List of segments which have been created.
14 create table segments (
15 segmentid integer primary key,
16 segment text unique not null
19 -- Index of all blocks which have been stored in a snapshot, by checksum.
20 create table block_index (
21 blockid integer primary key,
22 segmentid integer not null,
29 create index block_content_index on block_index(checksum);
30 create unique index block_name_index on block_index(segmentid, object);
32 -- Index tracking which blocks are used by which snapshots.
33 create table snapshot_contents (
37 create unique index snapshot_contents_unique
38 on snapshot_contents(blockid, snapshotid);