-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
Fully Compatible
-
200
-
None
-
None
-
None
-
None
-
None
-
None
-
None
This change modifies the `CatalogStats` struct to store cache size in bytes rather than pages, and introduces a new method `numPagesInStorageEngineCache()` that calculates the number of pages dynamically based on collection-specific page sizes. We found that different collections have can have differences in the average size of leaf pages, meaning that our estimate of the number of pages that can fit in the WT cache should depend on which collection we are probing into.
- Replaced `numPagesInStorageEngineCache` field with `bytesInStorageEngineCache` in `CatalogStats`
- Added `numPagesInStorageEngineCache()` method that computes pages using actual collection page sizes instead of assuming a fixed 32KiB page size
- Updated cost estimation calls in `JoinCostEstimatorImpl` to use the new method
This provides more accurate cost estimation by accounting for varying page sizes across different collections rather than using a hardcoded assumption.
- related to
-
SERVER-123146 [Join Optimization] Non-deterministic join plan selection due to use of oscillating onDiskSizeBytes in cost model
-
- Closed
-
-
SERVER-122681 [Join Optimization] Platform-dependent on-disk size differences cause plan stability test discrepancies
-
- Closed
-