Skip to content
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

(opt)(nereids) optimize and/or expression #44503

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

englefly
Copy link
Contributor

What problem does this PR solve?

And/or expressions are represented by binary trees. The depth of the tree causes stack overflow in recursive program calls. To solve this problem, this pr will flatten the binary tree when processing and/or, reducing the number of recursions. At the same time, we also rewrite some recursive programs into non-recursive forms to avoid stack overflow.

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:

Release note

None

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@doris-robot
Copy link

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@englefly
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

TPC-H: Total hot run time: 39679 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 04d054151d005efa022726edfa98a63ea7613fc8, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17603	7518	7298	7298
q2	2041	168	169	168
q3	10561	1126	1171	1126
q4	10217	736	729	729
q5	7593	2690	2694	2690
q6	242	148	147	147
q7	975	617	609	609
q8	9250	1833	1911	1833
q9	6484	6344	6397	6344
q10	6965	2306	2316	2306
q11	458	253	264	253
q12	q13	17762	2991	2992	2991
q14	240	208	210	208
q15	560	535	528	528
q16	667	590	602	590
q17	960	546	638	546
q18	7522	6582	6731	6582
q19	1540	1122	1101	1101
q20	433	176	176	176
q21	4038	3306	3140	3140
q22	371	320	314	314
Total cold run time: 106482 ms
Total hot run time: 39679 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	7279	7271	7256	7256
q2	334	225	232	225
q3	2848	2819	2989	2819
q4	2117	1890	1816	1816
q5	5558	5713	5656	5656
q6	219	136	141	136
q7	2154	1760	1813	1760
q8	3362	3550	3458	3458
q9	8866	8761	8771	8761
q10	3616	3517	3548	3517
q11	606	514	505	505
q12	q13	10762	3254	3223	3223
q14	294	267	267	267
q15	567	531	522	522
q16	692	644	649	644
q17	1849	1650	1564	1564
q18	7817	7359	7537	7359
q19	1647	1626	1579	1579
q20	2079	1828	1816	1816
q21	5313	5157	5130	5130
q22	645	578	533	533
Total cold run time: 68624 ms
Total hot run time: 58546 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants