- Ya
- 22 Agosti 2026, 06:40 UTC
- Mwandishi
- Kamo
- Ahadi ya
- 8a7b7fd
The org storage total is SUM(fileSize) over Img rows, and a derived version points at its original's ImgDat while copying its fileSize — so every modified version would have added its original's size to the bill a second time. Since merely opening a document to edit it derives one, that would eventually have doubled most of the total. A version now counts only once a save has given it an ImgDat of its own, at which point the bytes are real. The LEFT JOIN is load-bearing: navigating i.originalImg.dat in the WHERE clause is an implicit INNER join in HQL and would silently drop every row whose originalImg is null — every original, i.e. nearly the whole total. The failure mode is a storage figure that collapses to almost nothing with no error anywhere, so the query shape is pinned by tests.