mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) More accurate data size measurement
Summary: As suggested by @dsagal in https://phab.getgrist.com/D3277#inline-36801, change to query `SUM(pgsize - unused)` instead of `SUM(pgsize)` to measure actual data size more accurately. Technically this doesn't reflect the database file size as accurately, but it should reflect sandbox memory usage better, and more importantly it should allow users to see data size decreasing when they delete stuff. Test Plan: Tested manually by adding rows to a doc and looking at the logs. The data size is smaller and changes more granularly. Reviewers: dsagal, paulfitz Reviewed By: paulfitz Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3313
This commit is contained in:
parent
222dc505eb
commit
77a5d31afe
@ -1556,7 +1556,7 @@ export class DocStorage implements ISQLiteDB, OnDemandStorage {
|
|||||||
this._lastLoggedDataSize = now;
|
this._lastLoggedDataSize = now;
|
||||||
|
|
||||||
const result = await this.get(`
|
const result = await this.get(`
|
||||||
SELECT SUM(pgsize) AS totalSize
|
SELECT SUM(pgsize - unused) AS totalSize
|
||||||
FROM dbstat
|
FROM dbstat
|
||||||
WHERE NOT (
|
WHERE NOT (
|
||||||
name LIKE 'sqlite_%' OR
|
name LIKE 'sqlite_%' OR
|
||||||
|
Loading…
Reference in New Issue
Block a user