Make collStats
calculate collection size accurately after deletions of documents
#3483
Labels
area/diag
Issues about diagnostic commands
backend/pg
Issues about PostgreSQL backend
backend/sqlite
Issues about SQLite backend
code/chore
Code maintenance improvements
not ready
Issues that are not ready to be worked on; PRs that should skip CI
Milestone
What should be done?
Capped collections are fixed size collections.
Currently in PostgreSQL backend,
collStats
calculates collection size usingpg_table_size
andpg_indexes_size
.When we introduce capped collections, assuming running vacuum full is unlikely, the capped collection after many deletions and insertions will only increase in size with the current way of calculating collection size. This is inaccurate reflection of capped collection.
This issue is about finding way to report actual used size disregarding deleted items in the table.
This applies to both PostgreSQL and SQLite.
Where?
https://github.com/FerretDB/FerretDB/blob/main/internal/backends/postgresql/collection.go
https://github.com/FerretDB/FerretDB/blob/main/internal/backends/sqlite/collection.go
Definition of Done
The text was updated successfully, but these errors were encountered: