[tahoe-lafs-trac-stream] [Tahoe-LAFS] #1836: use leasedb (not crawler) to figure out how many shares you have and how many bytes
Tahoe-LAFS
trac at tahoe-lafs.org
Mon May 5 20:43:03 UTC 2014
#1836: use leasedb (not crawler) to figure out how many shares you have and how
many bytes
-------------------------+-------------------------------------------------
Reporter: zooko | Owner: markberger
Type: defect | Status: new
Priority: normal | Milestone: 1.12.0
Component: code- | Version: 1.9.2
storage | Keywords: leases garbage-collection test-
Resolution: | needed accounting
Launchpad Bug: |
-------------------------+-------------------------------------------------
Comment (by daira):
{{{
SELECT COUNT(*), SUM(`used_space`)
FROM (SELECT `used_space`
FROM `shares` s JOIN `leases` l"
ON (s.`storage_index` = l.`storage_index` AND s.`shnum` =
l.`shnum`)
GROUP BY s.`storage_index`, s.`shnum`)
}}}
My relational algebra may be a little rusty, but can't that be simplified
to:
{{{
SELECT COUNT(*), SUM(`used_space`)
FROM `shares` s JOIN `leases` l"
ON (s.`storage_index` = l.`storage_index` AND s.`shnum` = l.`shnum`)
GROUP BY s.`storage_index`, s.`shnum`
}}}
?
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1836#comment:28>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list