Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT h.epoch, h.system_id, m.id, m.name, m.tenant_unit_id, h.interval_mask, h.virtualspace_used AS pre_comp, h.post_comp_cumu
- AS post_comp, h.post_comp_last_24_hours, 0 AS comp_factor FROM hd_processed_space_mtrees AS h JOIN cd_cfg_mtrees m ON h.system_id = m.system_id AND
- h.mtree_id = m.mtree_id JOIN (SELECT max(epoch) AS epoch, m.id, h.tier_type FROM hd_processed_space_mtrees h JOIN cd_cfg_mtrees m
- ON h.system_id = m.system_id AND h.mtree_id = m.mtree_id WHERE h.tier_type=0 AND
- m.id IN (1, 2, 32, 33, 38, 39, 37, 42, 8, 11, 12, 13, 17, 16, 19, 18, 21, 22, 28, 30) AND h.epoch BETWEEN extract(epoch from now() - INTERVAL '1 YEAR')
- AND extract(epoch from now()) GROUP BY m.id, h.tier_type) maxEpoch ON maxEpoch.id = m.id
- WHERE (h.tier_type=0 AND m.id IN (1, 2, 32, 33, 38, 39, 37, 42, 8, 11, 12, 13, 17, 16, 19, 18, 21, 22, 28, 30) AND h.epoch
- BETWEEN extract(epoch from now() - INTERVAL '1 YEAR') AND extract(epoch from now()) AND m.tenant_unit_id=14 AND (interval_mask & 2 > 0)) OR
- (maxEpoch.epoch = h.epoch AND maxEpoch.id = m.id AND maxEpoch.tier_type = h.tier_type) ORDER BY h.epoch asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement