projects
/
cumulus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add GPLv2 license conditions.
[cumulus.git]
/
schema.sql
diff --git
a/schema.sql
b/schema.sql
index
e0f16a6
..
850e6a9
100644
(file)
--- a/
schema.sql
+++ b/
schema.sql
@@
-8,7
+8,8
@@
create table snapshots (
snapshotid integer primary key,
name text not null,
scheme text,
snapshotid integer primary key,
name text not null,
scheme text,
- timestamp real
+ timestamp real,
+ intent real
);
-- List of segments which have been created.
);
-- List of segments which have been created.
@@
-18,7
+19,8
@@
create table segments (
path text,
checksum text,
mtime real,
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.
);
-- Index of all blocks which have been stored, by checksum.
@@
-40,11
+42,13
@@
create table segments_used (
segmentid integer not null,
utilization real
);
segmentid integer not null,
utilization real
);
+create unique index segments_used_index
+ on segments_used(snapshotid, segmentid);
-- Overall estimate of segment utilization, for all snapshots combined.
create view segment_info as
-- 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)
from segments join
(select segmentid, max(utilization) as utilization
from segments_used group by segmentid)