Skip to content

Commit d5eba3b

Browse files
committed
disable prefetch again
1 parent bb0644f commit d5eba3b

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

  • datafusion/physical-plan/src/joins/grace_hash_join

datafusion/physical-plan/src/joins/grace_hash_join/stream.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,13 @@ use parking_lot::Mutex;
5858
const MAX_REPARTITION_PARTITIONS: usize = 256;
5959
/// Upper bound for concurrent spill chunk read-ahead when loading partitions.
6060
/// Keep this modest to avoid competing with the main partition budget.
61-
const SPILL_READAHEAD_BYTES: usize = 256 * 1024 * 1024;
61+
const SPILL_READAHEAD_BYTES: usize = 64 * 1024 * 1024;
6262
/// Below this size we avoid further repartitioning to keep file counts under control.
6363
const MIN_REPARTITION_BYTES: usize = 16 * 1024 * 1024;
6464

65-
/// Derive a prefetch cap for the next partition to avoid runaway memory use.
66-
/// We cap at half of the current budget but never exceed 512 MiB, and disable
67-
/// prefetch entirely for very small budgets to avoid churn.
68-
fn prefetch_cap_bytes(current_limit: usize) -> usize {
69-
const PREFETCH_HARD_CAP: usize = 512 * 1024 * 1024;
70-
const PREFETCH_MIN_BYTES: usize = 8 * 1024 * 1024;
71-
let cap = (current_limit / 2).min(PREFETCH_HARD_CAP);
72-
if cap < PREFETCH_MIN_BYTES {
73-
0
74-
} else {
75-
cap
76-
}
65+
/// Prefetch is disabled to avoid overlapping memory use with the active partition.
66+
fn prefetch_cap_bytes(_current_limit: usize) -> usize {
67+
0
7768
}
7869

7970
enum GraceJoinState {

0 commit comments

Comments
 (0)