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

[perf] improve delete from table without where & limit #13120

Merged
merged 25 commits into from Dec 10, 2023

Conversation

noorall
Copy link
Contributor

@noorall noorall commented Nov 30, 2023

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #12845

What this PR does / why we need it:

When a table does not have a foreign key. So for delete from table, it can be optimized to truncate.

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Nov 30, 2023
@matrix-meow matrix-meow added size/L Denotes a PR that changes [500,999] lines and removed size/M Denotes a PR that changes [100,499] lines labels Dec 1, 2023
@noorall noorall marked this pull request as ready for review December 3, 2023 13:07
@noorall noorall changed the title [perf] improve delete plan from table without where & limit [perf] improve delete from table without where & limit Dec 4, 2023
Copy link
Contributor

@nnsgmsone nnsgmsone left a comment

Choose a reason for hiding this comment

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

这应该是个不合理的改法,应该一个优化器规则,几十行代码就可以处理这个问题

@m-schen m-schen self-requested a review December 4, 2023 03:49
@matrix-meow matrix-meow added size/M Denotes a PR that changes [100,499] lines and removed size/L Denotes a PR that changes [500,999] lines labels Dec 5, 2023
Copy link
Contributor

@nnsgmsone nnsgmsone left a comment

Choose a reason for hiding this comment

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

做成优化器的规则如何呢。而不是物理计划的一个if else

@noorall
Copy link
Contributor Author

noorall commented Dec 7, 2023

做成优化器的规则如何呢。而不是物理计划的一个if else

现在的ddl不是一个算子的形式,ddl的参数直接从plan中获取,这个if else应该没办法避免

@matrix-meow matrix-meow added size/S Denotes a PR that changes [10,99] lines and removed size/M Denotes a PR that changes [100,499] lines labels Dec 7, 2023
Copy link
Contributor

@ouyuanning ouyuanning left a comment

Choose a reason for hiding this comment

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

处理一下影响行数的问题

@mergify mergify bot merged commit 118e577 into matrixorigin:main Dec 10, 2023
17 of 18 checks passed
noorall added a commit to noorall/matrixone that referenced this pull request Apr 8, 2024
…13120)

When a table does not have a foreign key. So for delete from table, it can be optimized to truncate.

Approved by: @m-schen, @nnsgmsone, @badboynt1, @aunjgr, @ouyuanning

(cherry picked from commit 118e577)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement size/S Denotes a PR that changes [10,99] lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants