File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -908,15 +908,16 @@ def _discover_inputs() -> Dict[str, List[Path]]:
908908 max_threads = min (int (memory_gb / 16 ), 8 ) # 1 thread per 16GB, max 8
909909 except ValueError :
910910 max_threads = 4
911- else :
912- memory_gb = float (merge_memory_limit_gb )
913- max_threads = min (int (memory_gb / 16 ), 8 ) # 1 thread per 16GB, max 8
914-
915- effective_threads = min (merge_threads , max_threads )
916- # Ensure at least 1 thread (DuckDB requires at least 1)
917- effective_threads = max (1 , effective_threads )
918- if merge_threads > max_threads :
919- print (f"[merge] Capping threads at { max_threads } (requested { merge_threads } ) based on memory_limit" )
911+ else :
912+ memory_gb = float (merge_memory_limit_gb )
913+ max_threads = min (int (memory_gb / 16 ), 8 ) # 1 thread per 16GB, max 8
914+
915+ effective_threads = min (merge_threads , max_threads )
916+ # Ensure at least 1 thread (DuckDB requires at least 1)
917+ effective_threads = max (1 , effective_threads )
918+ if merge_threads > max_threads :
919+ print (f"[merge] Capping threads at { max_threads } (requested { merge_threads } ) based on memory_limit" )
920+
920921 con .execute (f"PRAGMA threads = { effective_threads } " )
921922
922923 # Set memory limit - increase default for large merges
You can’t perform that action at this time.
0 commit comments