-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Labels:None
These fields are not being returned by default anymore by the dbStats command:
- freeStorageSize
- indexFreeStorageSize
- totalFreeStorageSize
In order to show them, the user needs to explicitly request them with the freeStorage option in the command or the mongo shell wrapper:
db.runCommand({dbStats: 1, freeStorage: 1}); db.stats({freeStorage: 1});
The mongo shell wrapper now accepts either a number (the scale, as it used to) or a document with options:
- scale: number, optional
- freeStorage: 0 or 1, optional
This ticket addresses a performance regression caused by accessing the information needed to populate those fields.
Description of Linked Ticket
After SERVER-50756, by default, the dbStats command now returns how much unoccupied storage space is being used for collections,
indexes, and in total: freeStorageSize, indexFreeStorageSize, and totalFreeStorageSize.
For customers with many tables, this feature adds a performance regression.
- backported by
-
DOCS-15047 [Server] [v5.0] Performance regression from dbstats due to occupied disk space calculation
- Closed
- depends on
-
MONGOSH-1108 db.stats() returns MongoServerError: scale has to be a number
- Closed
- documents
-
SERVER-62277 Performance regression from dbstats due to occupied disk space calculation
- Closed
- is depended on by
-
DOCS-15053 [Server] [Backport v5.2] Performance regression from dbstats due to occupied disk space calculation
- Closed