From 3cfd653db1cbed174d6b9d727d38b361db0aac33 Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 6 Jun 2023 11:38:41 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Louis Dureuil --- index-scheduler/src/index_mapper/mod.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index-scheduler/src/index_mapper/mod.rs b/index-scheduler/src/index_mapper/mod.rs index 86bec2927..e5bac4d30 100644 --- a/index-scheduler/src/index_mapper/mod.rs +++ b/index-scheduler/src/index_mapper/mod.rs @@ -88,9 +88,16 @@ pub enum IndexStatus { pub struct IndexStats { /// Number of documents in the index. pub number_of_documents: u64, - /// Size of the index' DB, in bytes. + /// Size taken up by the index' DB, in bytes. + /// + /// This includes the size taken by both the used and free pages of the DB, and as the free pages + /// are not returned to the disk after a deletion, this number is typically larger than + /// `used_database_size` that only includes the size of the used pages. pub database_size: u64, - /// Size of the index' DB, in bytes. + /// Size taken by the used pages of the index' DB, in bytes. + /// + /// As the DB backend does not return to the disk the pages that are not currently used by the DB, + /// this value is typically smaller than `database_size`. pub used_database_size: u64, /// Association of every field name with the number of times it occurs in the documents. pub field_distribution: FieldDistribution,