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
Support reusing the physical plan in prepared statements #26706
Is your feature request related to a problem or challenge?
Building and optimizing the physical plan can be relatively expensive when we execute small queries. Currently, DataFusion's prepared statements only reuse the logical plan.
In a proof of concept, I found that we can improve the performance of small queries in >3x if we just reuse the physical plan.
This was done in a hacky way that first created the physical plan using placeholder arguments and at runtime replaced nodes like DataSourceExec and FilterExec with the passed arguments.
Describe the solution you'd like
For a clean implementation, I think we need the following:
Build ExecutionPlan from queries with placeholder values.
Add a ExecutionPlan::set_placeholder (or similar) method that is implemented by every operator that uses placeholder values, changing only what is necessary and returning a new plan that can be consumed.
Activity