You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EPIC] A collection of tickets for improving sorting larger than memory datasets / spilling sorts #15271
changed the title [-][EPIC] A collection of tickets for improving sorting larger-than-ram datasets[/-][+][EPIC] A collection of tickets for improving sorting larger-than-ram datasets / spilling sorts[/+]on Mar 17, 2025
I also think that by collecting the related items we may be able to find some more review capacity (as I think this is an important capability for Spark / Comet. FYI @comphead / @andygrove / @kazuyukitanimura )
changed the title [-][EPIC] A collection of tickets for improving sorting larger-than-ram datasets / spilling sorts[/-][+][EPIC] A collection of tickets for improving sorting larger than memory datasets / spilling sorts[/+]on Mar 17, 2025
@alamb Thank you for summarizing, I'm also interested in this topic and may have more time to join the game in May, but I will keep an eye on the progress.
I saw while debugging some performance issue in AggregateExec I see that we keep all spilled files open (RefCountedTempFile as it keep tempfile which hold File).
and also when merging we read at least 1 batch from every spill file:
let stream = self.spill_state.spill_manager.read_spill_as_stream(spill)?;
streams.push(stream);
}
so If I have a lot of spill files or if every batch is really huge (contains very large lists - like result for array_agg on large dataset) we have all of this in memory.
so If I have a lot of spill files or if every batch is really huge (contains very large lists - like result for array_agg on large dataset) we have all of this in memory.
Activity
[-][EPIC] A collection of tickets for improving sorting larger-than-ram datasets[/-][+][EPIC] A collection of tickets for improving sorting larger-than-ram datasets / spilling sorts[/+]alamb commentedon Mar 17, 2025
I also think that by collecting the related items we may be able to find some more review capacity (as I think this is an important capability for Spark / Comet. FYI @comphead / @andygrove / @kazuyukitanimura )
[-][EPIC] A collection of tickets for improving sorting larger-than-ram datasets / spilling sorts[/-][+][EPIC] A collection of tickets for improving sorting larger than memory datasets / spilling sorts[/+]alamb commentedon Mar 19, 2025
I filed some more tickets about ways to improve performance with external spill files
mmapthe spill files #15321andygrove commentedon Mar 19, 2025
I added #15323
xudong963 commentedon Mar 20, 2025
@alamb Thank you for summarizing, I'm also interested in this topic and may have more time to join the game in May, but I will keep an eye on the progress.
Add resource limits to datafusion config.
Add resource limits to datafusion config.
Add resource limits to datafusion config.
rluvaton commentedon Apr 2, 2025
I saw while debugging some performance issue in
AggregateExecI see that we keep all spilled files open (RefCountedTempFileas it keeptempfilewhich holdFile).and also when merging we read at least 1 batch from every spill file:
datafusion/datafusion/physical-plan/src/aggregates/row_hash.rs
Lines 1059 to 1062 in 7317198
so If I have a lot of spill files or if every batch is really huge (contains very large lists - like result for array_agg on large dataset) we have all of this in memory.
alamb commentedon Apr 3, 2025
I think this is the same underlying cause as
alamb commentedon Sep 16, 2025
I think most of this epic is done and DataFusion now has a very solid spilling sort implementation 🎉
To make the current state clear, I moved the issues that are not currently completed to a new epic and will close this one