-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate native query planning overhead #1098
Comments
The reason that each plan appears to be planned twice is that we split the
|
For comparison, physical planning time in Ballista for the same query (TPC-H q3) never takes more than 1ms, and overall execution time is ~6 seconds compares to ~20 seconds in Comet. |
This is getting pretty interesting. I improved the native explain feature in #1099 and we now see the planning time. The following trivial plan takes more than a second to plan.
I also added a criterion benchmark to plan this query in the same PR, and it only takes 23 microseconds. Another observation is that the planning time increases each time:
Something strange is happening here. Does this indicate that some sort of contention or locking is happening which is resulting in these long times? |
There are other instances where the planning is much faster:
|
Plan creation time can take longer than actually executing the plan in some cases:
|
What is the problem the feature request solves?
For each query stage, the serialized query plan is sent to the executor with each task. Each task deserializes the protobuf and then creates a
PhysicalPlanner
and builds a native query plan. The query plan for each partition in a stage is essentially identical, except for the scan input JNI references, so we are duplicating this query planning work across each partition.In some cases, planning is very expensive, TPC-H q3 stage 18 seems to take around 90 seconds. Here is partial debug output. Note that each partition seems to create the query plan twice, which needs further investigation.
Here is another example where planning is relatively cheap, but repeated many times, resulting in 1.76 seconds total planning time.
Questions:
I used the following code to pass the partition numbers to the native code:
Describe the potential solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: