alamb opened a new issue, #28002:
URL: https://github.com/apache/datafusion/issues/28002

   ### Is your feature request related to a problem or challenge?
   
   This is a potential alternate to this idea from @askalt but with the same 
usecase
   - https://github.com/apache/datafusion/issues/19351
   
   Quoting the usecase
   
   > We are working on a DBMS that uses DataFusion as the SQL query engine. In 
general, there is a challenge: physical plan building bottlenecks. The impact 
can be reduced to some degree, but as the number of optimizations increases, 
query latency becomes uncontrollable.
   > 
   > It would be beneficial to reuse a single plan across many executions (like 
a prepared statement). The problem is not so much ideological as technical: the 
current implementation stores execution-stage state in the plan itself and 
generally does not assume that execute(...) can be called more than once or 
concurrently for the same Arc<dyn ExecutionPlan>.
   
   ### Describe the solution you'd like
   
   An alternate solution would be to move the plan state on to the existing 
[`TaskContext`](https://docs.rs/datafusion/latest/datafusion/execution/struct.TaskContext.html)
 structure, which is already created once per query. 
   
   The idea here would then be that DynamicFilters, materialized CTEs, pointers 
to shared join hash tables, etc would all live on the `TaskContext` rather than 
as fields on `ExecutionPlan`.  Thus to run multiple queries, we would just fire 
up multiple task contexts
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_
   
   ### Willingness to contribute
   
   None


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to