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

Speed up dump for sql engine #1006

Merged
merged 5 commits into from
Nov 18, 2021
Merged

Speed up dump for sql engine #1006

merged 5 commits into from
Nov 18, 2021

Conversation

zhijian-pro
Copy link
Contributor

Speed up for dbmeta

@codecov-commenter
Copy link

codecov-commenter commented Nov 17, 2021

Codecov Report

Merging #1006 (0696061) into main (630263d) will increase coverage by 0.12%.
The diff coverage is 70.65%.

❗ Current head 0696061 differs from pull request most recent head a077919. Consider uploading reports for the commit a077919 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1006      +/-   ##
============================================
+ Coverage     37.20%   37.33%   +0.12%     
  Complexity       33       33              
============================================
  Files           146      146              
  Lines         23560    23682     +122     
  Branches        422      422              
============================================
+ Hits           8766     8841      +75     
- Misses        13617    13651      +34     
- Partials       1177     1190      +13     
Impacted Files Coverage Δ
pkg/meta/dump.go 56.12% <ø> (-5.64%) ⬇️
pkg/meta/sql.go 67.07% <70.65%> (+<0.01%) ⬆️
pkg/meta/tkv_mem.go 86.71% <0.00%> (-0.70%) ⬇️
pkg/meta/tkv.go 72.71% <0.00%> (-0.31%) ⬇️
pkg/vfs/handle.go 77.31% <0.00%> (+0.84%) ⬆️
pkg/vfs/reader.go 66.05% <0.00%> (+1.27%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 630263d...a077919. Read the comment docs.

@davies davies changed the title Speed up for db Speed up dump for sql engine Nov 17, 2021
pkg/meta/sql.go Outdated
if err != nil {
return nil, err
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we skip the edge and continue (log it as warning)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has been modified

2. Skip the case where entry is equal to nil
…l show estimated arrival time

Fix the problem that the SQL statement of a single submission is too long, which causes the placeholder to exceed the upper limit
@zhijian-pro
Copy link
Contributor Author

zhijian-pro commented Nov 18, 2021

Performance Testing

data and env:

  1. A total of 1000000 empty files are evenly distributed in 200 local folders
  2. Local mysql

result:

old version

  • mysql dump: 3600s
  • mysql load: 46m

new version

  • mysql dump :25s
  • mysql load: 8m

Test conclusion

  • The performance of the dump operation is improved by 144 times
  • The performance of the load operation is improved by 5 times

@davies davies merged commit 1a3d56c into juicedata:main Nov 18, 2021
@zhijian-pro zhijian-pro deleted the speed_up_for_db branch January 28, 2022 01:17
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.

3 participants