@@ -24,15 +24,24 @@ impl MemoryUsage for PagePool {
24
24
25
25
impl PagePool {
26
26
pub fn new_for_test ( ) -> Self {
27
- Self :: new ( None )
27
+ Self :: new ( Some ( 100 * size_of :: < Page > ( ) ) )
28
28
}
29
29
30
30
/// Returns a new page pool with `max_size` bytes rounded down to the nearest multiple of 64 KiB.
31
31
///
32
- /// if no size is provided, a default of 8 GiB is used.
32
+ /// if no size is provided, a default of 1 page is used.
33
33
pub fn new ( max_size : Option < usize > ) -> Self {
34
- const DEFAULT_MAX_SIZE : usize = 8 * ( 1 << 30 ) ; // 8 GiB
35
- const PAGE_SIZE : usize = 64 * ( 1 << 10 ) ; // 64 KiB, `size_of::<Page>()`
34
+ const PAGE_SIZE : usize = size_of :: < Page > ( ) ;
35
+ // TODO(centril): This effectively disables the page pool.
36
+ // Currently, we have a test `test_index_scans`.
37
+ // The test sets up a `Location` table, like in BitCraft, with a `chunk` field,
38
+ // and populates it with 1000 different chunks with 1200 rows each.
39
+ // Then it asserts that the cold latency of an index scan on `chunk` takes < 1 ms.
40
+ // However, for reasons currently unknown to us,
41
+ // a large page pool, with capacity `1 << 26` bytes, on i7-7700K, 64GB RAM,
42
+ // will turn the latency into 30-40 ms.
43
+ // As a precaution, we disable the page pool by default.
44
+ const DEFAULT_MAX_SIZE : usize = PAGE_SIZE ; // 1 page
36
45
37
46
let queue_size = max_size. unwrap_or ( DEFAULT_MAX_SIZE ) / PAGE_SIZE ;
38
47
let inner = Arc :: new ( PagePoolInner :: new ( queue_size) ) ;
0 commit comments