Skip to content

Conversation

@aschackmull
Copy link
Contributor

A small join-order fix found as the predicate was highlighted by the join-order metric in the nightly dca. This is an easy use-case for doublyBoundedFastTC.

Before:

[2025-02-03 11:53:13] Evaluated non-recursive predicate TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::irrelevantBound/2#c4c997e4@514067bu in 570ms (size: 20040).
Evaluated relational algebra for predicate TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::irrelevantBound/2#c4c997e4@514067bu with tuple counts:
          9241596    ~0%    {2} r1 = JOIN `ListOfConstantsSanitizer::FlowNode.getType/0#dispred#c357ef9f_10#join_rhs` WITH `Type::hasDescendant/2#170e5922_10#join_rhs` ON FIRST 1 OUTPUT Lhs.1, Rhs.1
            18552    ~6%    {2}    | JOIN WITH `TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeFlow/2#25c00c35` ON FIRST 2 OUTPUT Lhs.0, Lhs.1
                        
            68814    ~0%    {2} r2 = JOIN `TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeFlow/2#25c00c35_10#join_rhs` WITH `TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeBound/1#e9ea7ad4` ON FIRST 1 OUTPUT Lhs.0, Lhs.1
         42870964    ~0%    {3}    | JOIN WITH `Type::hasDescendant/2#170e5922` ON FIRST 1 OUTPUT Rhs.1, Lhs.1, Lhs.0
        164060490  ~285%    {3}    | JOIN WITH `Type::hasSubtype/2#dfe9f860` ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.2
             3841   ~19%    {3}    | JOIN WITH `TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeFlow/2#25c00c35` ON FIRST 2 OUTPUT Lhs.1, Lhs.2, Lhs.0
                            {3}    | AND NOT `Type::hasDescendant/2#170e5922`(FIRST 2)
             2973    ~0%    {2}    | SCAN OUTPUT In.2, In.1
                        
            21525   ~12%    {2} r3 = r1 UNION r2
                            return r3

After:

[2025-02-03 12:01:38] Evaluated non-recursive predicate doublyBoundedFastTC@TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::hasSupertype/2#a789612d#2@TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeBound/1#e9ea7ad4#1@TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeBound/1#e9ea7ad4#1@7420a2cd in 14ms (size: 28754).
[2025-02-03 12:01:38] Evaluated non-recursive predicate TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::irrelevantBound/2#c4c997e4@e6ee30u0 in 24ms (size: 20040).
Evaluated relational algebra for predicate TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::irrelevantBound/2#c4c997e4@e6ee30u0 with tuple counts:
        9241596   ~0%    {2} r1 = JOIN `ListOfConstantsSanitizer::FlowNode.getType/0#dispred#c357ef9f_10#join_rhs` WITH `Type::hasDescendant/2#170e5922_10#join_rhs` ON FIRST 1 OUTPUT Lhs.1, Rhs.1
          18552   ~6%    {2}    | JOIN WITH `TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeFlow/2#25c00c35` ON FIRST 2 OUTPUT Lhs.0, Lhs.1
                     
         332048   ~5%    {3} r2 = JOIN `TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeFlow/2#25c00c35_10#join_rhs` WITH `doublyBoundedFastTC:Type::RefType.getASupertype/0#dispred#ba3c9ecb:_TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeBound/1#e9ea7ad4#higher_order_body:TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeBound/1#e9ea7ad4` ON FIRST 1 OUTPUT Lhs.1, Rhs.1, Lhs.0
           3141   ~0%    {3}    | JOIN WITH `TypeFlowImpl::TypeFlow<Location::Location,TypeFlow::Input>::typeFlow/2#25c00c35` ON FIRST 2 OUTPUT Lhs.2, Lhs.1, Lhs.0
                         {3}    | AND NOT `Type::hasDescendant/2#170e5922`(FIRST 2)
           2961   ~0%    {2}    | SCAN OUTPUT In.2, In.1
                     
          21513  ~12%    {2} r3 = r1 UNION r2
                         return r3

@aschackmull aschackmull added the no-change-note-required This PR does not need a change note label Feb 3, 2025
Copilot AI review requested due to automatic review settings February 3, 2025 11:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

@aschackmull aschackmull force-pushed the java/typeflow-joinorder branch from 7c81a68 to ce976dc Compare February 4, 2025 09:12
@aschackmull
Copy link
Contributor Author

dca looks fine.

@aschackmull aschackmull merged commit 5773538 into github:main Feb 6, 2025
31 checks passed
@aschackmull aschackmull deleted the java/typeflow-joinorder branch February 6, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants