[SERVER-71796] [CQF] Make union cost commutative Created: 02/Dec/22  Updated: 29/Oct/23  Resolved: 03/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matt Boros Assignee: Svilen Mihaylov (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2023-02-06
Participants:

 Description   

Costing a UnionNode is not a commutative operation. It does not use the CE estimate of the first child, but does use every other child's CE estimate. This operation should be commutative in theory.

It looks like the total cost should be startupCost plus child.cost + incrementalCost * child.ce for each child.

 

Also need to handle the special cast of a union node with one child which is used in its capacity to restrict the projections propagated up to the parent.



 Comments   
Comment by Githook User [ 03/Feb/23 ]

Author:

{'name': 'Svilen Mihaylov', 'email': 'svilen.mihaylov@mongodb.com', 'username': 'svilen-mihaylov'}

Message: SERVER-71796 [CQF] Make union cost commutative
Branch: master
https://github.com/mongodb/mongo/commit/b3f98b5aba5faa1e9d661f1529822664db2373b2

Comment by Alexander Ignatyev [ 07/Dec/22 ]

Not in the scope of PM-2514, which is closing down, should be triaged.

Generated at Thu Feb 08 06:19:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.