This repository has been archived by the owner on Feb 20, 2023. It is now read-only.
Re-design execution engine's output pipeline. #1270
Labels
performance
Performance related issues or changes.
Feature Request
Summary
The execution currently buffers query output into local buffers and invokes a callback once these buffers are full. These intermediate buffers add overhead since we materialize "fat" SQL values, but also prevent the consumer of the query to push down logic into generated code.
Side note: The current
OutputCallback
can be invoked by multiple threads, but isn't documented for some reason.Solution
I propose adding an
ExecutionTarget
interface type that participates in the translation infrastructure. Subclasses have the opportunity to generate code as part of the push-based data flow. This will replace the existingOutputTranslator
. It is the responsibility of thisExecutionTarget
to consume the result of the output. This also allows execution targets to be aware of and specialize handling for parallel query execution.A trivial policy duplicates the current
OutputTranslator
logic into aBufferingExecutionTarget
type that buffers results and dispatches into an injected callback. Another example would be aLibpqxxExecutionTarget
that direclty invokes functions to serialize rows into network buffers.This is the approach I've taken in my TPL repo, and it seems to work pretty well.
The text was updated successfully, but these errors were encountered: