Skip to content

Improve sql planing performance (optimize try_process_unnest) #16242

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

While I was reviewing #16217 I did some profiling on the planning benchmarks

It looks like more than 2% of the planning time is spent trying to plan UNEST in the planner, but none of the benchmark queries have any UNEST in them

Image

Describe the solution you'd like

Since tpch q10 doesn't have any unnest statements in it, spending 2% of the planning time trying to plan them makes no sense. I think we can improve the planning performance significantly

Describe alternatives you've considered

To reproduce:

cargo bench --profile=profiling --bench sql_planner physical_plan_tpch_q10

Then use samply as described in the docs:

samply record target/profiling/deps/sql_planner-88f105135556ad27 --bench physical_plan_tpch_q10

(note you will have to update the actual binary name based on the output of running cargo bench

Additional context

This would be a good issue for someone who was reasonably familiar with Rust and DataFusion and wanted to work on optimization

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions