projects
/
cumulus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Implement a simple backend script to store data to Amazon S3.
[cumulus.git]
/
schema.sql
diff --git
a/schema.sql
b/schema.sql
index
8529e32
..
850e6a9
100644
(file)
--- a/
schema.sql
+++ b/
schema.sql
@@
-19,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.
@@
-46,8
+47,8
@@
create unique index segments_used_index
-- 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)