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

feat: auto optimize table during execution of replace into statement #12100

Merged
merged 4 commits into from
Jul 17, 2023

Conversation

dantengsky
Copy link
Member

@dantengsky dantengsky commented Jul 17, 2023

I hereby agree to the terms of the CLA available at: https://databend.rs/dev/policies/cla/

Summary

this PR is a squashed version of #12059

  • auto recluster

during the execution of replace-into, the table will be auto optimize compact, and that implies if the table being replaced-into has a cluster key, it will be automatically reclustered as well (see PR #11850)

  • more metrics (about the execution of the replace-into statement)

besides CI, this PR has been tested by

https://github.com/dantengsky/rr

using both

  • local dev box

single node deployment, local fs; 65000 iterations,

  • and dev-cloud

medium size WH; 25000 iterations

for both settings, no error was detected.

  • Closes #issue

@vercel
Copy link

vercel bot commented Jul 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
databend ⬜️ Ignored (Inspect) Jul 17, 2023 8:44am

@dantengsky dantengsky marked this pull request as ready for review July 17, 2023 04:27
@dantengsky dantengsky requested a review from zhyass July 17, 2023 04:27
@github-actions github-actions bot added the pr-feature this PR introduces a new feature to the codebase label Jul 17, 2023
@BohuTANG BohuTANG merged commit 4f82e18 into databendlabs:main Jul 17, 2023
SkyFan2002 added a commit to SkyFan2002/databend that referenced this pull request Jul 26, 2023
BohuTANG pushed a commit that referenced this pull request Aug 10, 2023
* refactor copy into

* fix panic

* fix

* fix

* fix

* make lint

* fix logic error

* replace into values

* fix

* fix

* fix render result

* fix schema cast

* temp

* respect #12147

* respect #12100

* make lint

* respect #12130

* fix merge

* add exchange

* fix conflict

* fix schema cast

* fix conlfict

* fix

* fix copy plan

* clear log

* fix copy

* fix copy

* run ci

* fix purge

* make lint

* add exchange

* disable dist for value source

* adjust exchange

* remove top exchange

* adjust replace into

* reshuffle

* fix

* fix reshuffle

* move segment_partition_num

* resolve conflicts

* add need insert flag

* unbranched_replace_into_processor

* merge only pipeline

* fix segment index

* fix conflict

* remove log

* fix empty table

* fix stateful test

* fix stateful test

* modify test

* fix typo

* fix random source

* add setting

* remove empty file

* remove dead code

* add default setting

* Update src/query/service/src/interpreters/interpreter_replace.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/sql/src/executor/physical_plan_display.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/storages/fuse/src/operations/replace_into/processors/processor_unbranched_replace_into.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/sql/src/executor/physical_plan.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/sql/src/executor/physical_plan_display.rs

Co-authored-by: dantengsky <[email protected]>

* rename struct

* default 0

* regen golden file

* set enable_distributed_replace_into = 1 in slt

* make lint

---------

Co-authored-by: dantengsky <[email protected]>
Co-authored-by: JackTan25 <[email protected]>
andylokandy pushed a commit to andylokandy/databend that referenced this pull request Nov 27, 2023
databendlabs#12100)

* chain replace into with optimize table

* tweak sqllogic test case

* fix typo

* Update src/query/service/src/interpreters/interpreter_table_optimize.rs
andylokandy pushed a commit to andylokandy/databend that referenced this pull request Nov 27, 2023
…2119)

* refactor copy into

* fix panic

* fix

* fix

* fix

* make lint

* fix logic error

* replace into values

* fix

* fix

* fix render result

* fix schema cast

* temp

* respect databendlabs#12147

* respect databendlabs#12100

* make lint

* respect databendlabs#12130

* fix merge

* add exchange

* fix conflict

* fix schema cast

* fix conlfict

* fix

* fix copy plan

* clear log

* fix copy

* fix copy

* run ci

* fix purge

* make lint

* add exchange

* disable dist for value source

* adjust exchange

* remove top exchange

* adjust replace into

* reshuffle

* fix

* fix reshuffle

* move segment_partition_num

* resolve conflicts

* add need insert flag

* unbranched_replace_into_processor

* merge only pipeline

* fix segment index

* fix conflict

* remove log

* fix empty table

* fix stateful test

* fix stateful test

* modify test

* fix typo

* fix random source

* add setting

* remove empty file

* remove dead code

* add default setting

* Update src/query/service/src/interpreters/interpreter_replace.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/sql/src/executor/physical_plan_display.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/storages/fuse/src/operations/replace_into/processors/processor_unbranched_replace_into.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/sql/src/executor/physical_plan.rs

Co-authored-by: dantengsky <[email protected]>

* Update src/query/sql/src/executor/physical_plan_display.rs

Co-authored-by: dantengsky <[email protected]>

* rename struct

* default 0

* regen golden file

* set enable_distributed_replace_into = 1 in slt

* make lint

---------

Co-authored-by: dantengsky <[email protected]>
Co-authored-by: JackTan25 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-feature this PR introduces a new feature to the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants