Summary
Replace ExecuteResult (materialized rows slice) with a streaming iterator interface to reduce memory usage, enable large result sets, and support backpressure.
Motivation
Current ExecuteResult loads all rows into memory. This is inefficient for large queries and prevents streaming results over wire protocols. An iterator-based approach enables:
- Low memory usage
- Early row delivery
- Better integration with network streaming
- Cancellation/backpressure
Goals
- Introduce a uniform RowIterator abstraction.
- Preserve current APIs via adapters during transition.
- Minimize breaking changes for existing executor logic.
Non-Goals
- Changing SQL semantics.
- Rewriting storage engine internals beyond result delivery.
- Adding distributed sharding here.
Summary
Replace ExecuteResult (materialized rows slice) with a streaming iterator interface to reduce memory usage, enable large result sets, and support backpressure.
Motivation
Current ExecuteResult loads all rows into memory. This is inefficient for large queries and prevents streaming results over wire protocols. An iterator-based approach enables:
Goals
Non-Goals