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

statistics: build the table analysis job queue #51045

Merged

Conversation

Rustin170506
Copy link
Member

@Rustin170506 Rustin170506 commented Feb 7, 2024

What problem does this PR solve?

Issue Number: ref #50132

Problem Summary:

What changed and how does it work?

Description

This pull request completes the process for analyzing non-partitioned tables in the job queue.

It calculates three metrics:

  1. change percent
  2. table size (cols * row_count)
  3. detection of any special events (new index)

There is also a dummy calculator added, I will implement it after this PR is done.

Explanation of Changes

  • Added support for building analysis job queue. (only for non-partitioned tables)
  • Also added tests for it.
  • Moved some common functions to the exec package.

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

None

@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-tests-checked release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-tests-checked size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 7, 2024
@Rustin170506 Rustin170506 changed the title feat: build the table analysis job queue statistics: build the table analysis job queue Feb 7, 2024
@ti-chi-bot ti-chi-bot bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 7, 2024
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

Merging #51045 (2710770) into master (aa4f4da) will decrease coverage by 17.4335%.
Report is 2 commits behind head on master.
The diff coverage is 81.5028%.

Additional details and impacted files
@@                Coverage Diff                @@
##             master     #51045         +/-   ##
=================================================
- Coverage   72.3987%   54.9652%   -17.4335%     
=================================================
  Files          1467       1577        +110     
  Lines        361889     604567     +242678     
=================================================
+ Hits         262003     332302      +70299     
- Misses        80662     249375     +168713     
- Partials      19224      22890       +3666     
Flag Coverage Δ
integration 37.0089% <0.0000%> (?)
unit 70.6744% <81.5028%> (-1.5923%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 53.9957% <ø> (-2.3014%) ⬇️
parser ∅ <ø> (∅)
br 51.4178% <ø> (+4.9600%) ⬆️

@ti-chi-bot ti-chi-bot bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 8, 2024
@Rustin170506
Copy link
Member Author

/retest

1 similar comment
@hawkingrei
Copy link
Member

/retest

Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

🔢 Self-check

@Rustin170506 Rustin170506 force-pushed the rustin-patch-build-job-queue branch from df91498 to 6defd3c Compare February 14, 2024 13:47
@Rustin170506 Rustin170506 force-pushed the rustin-patch-build-job-queue branch 2 times, most recently from a4ec4df to ecfd0f0 Compare February 19, 2024 07:15
@ti-chi-bot ti-chi-bot bot added approved needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 19, 2024
@Rustin170506 Rustin170506 force-pushed the rustin-patch-build-job-queue branch from 80d8173 to dc39e50 Compare February 19, 2024 09:48
Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

🔢 Self-check

@Rustin170506 Rustin170506 force-pushed the rustin-patch-build-job-queue branch from 3194ad4 to c6179cc Compare February 21, 2024 12:41
Signed-off-by: hi-rustin <[email protected]>

refactor: rename

Signed-off-by: hi-rustin <[email protected]>

refactor: remove partition part

Signed-off-by: hi-rustin <[email protected]>

refactor: use common functions from exec

Signed-off-by: hi-rustin <[email protected]>

fix: use exec

Signed-off-by: hi-rustin <[email protected]>

feat: calculate time and size

Signed-off-by: hi-rustin <[email protected]>

test: add test case

Signed-off-by: hi-rustin <[email protected]>

test: add more cases

Signed-off-by: hi-rustin <[email protected]>

fix: make clippy happy

Signed-off-by: hi-rustin <[email protected]>

fix: set txn correctly

Signed-off-by: hi-rustin <[email protected]>

fix: use physical time

Signed-off-by: hi-rustin <[email protected]>

chroe: add TODO

Signed-off-by: hi-rustin <[email protected]>

fix: make lint happy

Signed-off-by: hi-rustin <[email protected]>

fix: compile issue

Signed-off-by: hi-rustin <[email protected]>

fix: build issue

Signed-off-by: hi-rustin <[email protected]>

fix: compile issue

Signed-off-by: hi-rustin <[email protected]>

fix: build issue

Signed-off-by: hi-rustin <[email protected]>

refactor: better code

Signed-off-by: hi-rustin <[email protected]>

tests: add more cases

Signed-off-by: hi-rustin <[email protected]>

test: add more cases

Signed-off-by: hi-rustin <[email protected]>

test: add more cases

Signed-off-by: hi-rustin <[email protected]>

Update header and rename

Signed-off-by: hi-rustin <[email protected]>

fix: typo

Signed-off-by: hi-rustin <[email protected]>
@Rustin170506 Rustin170506 force-pushed the rustin-patch-build-job-queue branch from c6179cc to 2710770 Compare February 21, 2024 12:42
Copy link
Member Author

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

🔢 Self-check

@Rustin170506
Copy link
Member Author

/retest

Copy link

ti-chi-bot bot commented Feb 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hawkingrei, qw4990

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 22, 2024
Copy link

ti-chi-bot bot commented Feb 22, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-02-19 07:34:39.681827266 +0000 UTC m=+256168.429450375: ☑️ agreed by hawkingrei.
  • 2024-02-22 06:49:23.267787184 +0000 UTC m=+512652.015410295: ☑️ agreed by qw4990.

@ti-chi-bot ti-chi-bot bot merged commit 671e980 into pingcap:master Feb 22, 2024
23 checks passed
@Rustin170506 Rustin170506 deleted the rustin-patch-build-job-queue branch February 22, 2024 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved component/statistics lgtm release-note-none Denotes a PR that doesn't merit a release note. sig/planner SIG: Planner size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants