grafeo_core/execution/spill/mod.rs
1//! Disk spilling for queries that exceed available memory.
2//!
3//! When a sort or aggregation grows too large for RAM, we spill partitions to
4//! disk and merge them back later. This lets queries complete even with limited
5//! memory - just slower.
6//!
7//! | Component | Purpose |
8//! | --------- | ------- |
9//! | [`SpillManager`] | Manages spill file lifecycle with automatic cleanup |
10//! | [`SpillFile`] | Read/write individual spill files |
11//! | [`ExternalSort`] | External merge sort for big ORDER BY |
12//! | [`PartitionedState`] | Hash partitioning for spillable GROUP BY |
13//!
14//! Async variants (`AsyncSpillManager`, `AsyncSpillFile`) use tokio for
15//! non-blocking I/O when running in async contexts.
16
17mod async_file;
18mod async_manager;
19mod external_sort;
20mod file;
21mod manager;
22mod partition;
23mod serializer;
24
25pub use async_file::{AsyncSpillFile, AsyncSpillFileReader};
26pub use async_manager::AsyncSpillManager;
27pub use external_sort::{ExternalSort, NullOrder, SortDirection, SortKey};
28pub use file::{SpillFile, SpillFileReader};
29pub use manager::SpillManager;
30pub use partition::{DEFAULT_NUM_PARTITIONS, PartitionedState};
31pub use serializer::{deserialize_row, deserialize_value, serialize_row, serialize_value};