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

optimize: optimize the speed of buildLockKey #3700

Merged
merged 10 commits into from
May 3, 2021

Conversation

caohdgege
Copy link
Contributor

@caohdgege caohdgege commented May 2, 2021

Ⅰ. Describe what this PR did

// K为主键个数(getTableMeta().getPrimaryKeyOnlyName().size())
// M为字段数(getTableMeta().getAllColumns().size())
// N为行数(pksRows.size())

// 原复杂度
// N * M * K

// 优化后复杂度
// N * K

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

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

LGTM

@funky-eyes funky-eyes added this to the 1.5.0 milestone May 2, 2021
@codecov-commenter
Copy link

codecov-commenter commented May 2, 2021

Codecov Report

Merging #3700 (da4cabc) into develop (c3a441c) will increase coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #3700   +/-   ##
==========================================
  Coverage      51.92%   51.93%           
  Complexity      3503     3503           
==========================================
  Files            639      639           
  Lines          21182    21184    +2     
  Branches        2634     2634           
==========================================
+ Hits           10999    11001    +2     
  Misses          9089     9089           
  Partials        1094     1094           
Impacted Files Coverage Δ Complexity Δ
.../rm/datasource/exec/mysql/MySQLInsertExecutor.java 69.41% <0.00%> (ø) 16.00 <0.00> (ø)
...urce/exec/postgresql/PostgresqlInsertExecutor.java 43.75% <20.00%> (ø) 4.00 <0.00> (ø)
...m/datasource/exec/oracle/OracleInsertExecutor.java 62.50% <50.00%> (ø) 5.00 <0.00> (ø)
.../rm/datasource/exec/BaseTransactionalExecutor.java 59.09% <100.00%> (+0.31%) 27.00 <0.00> (ø)
...o/seata/rm/datasource/sql/struct/TableRecords.java 75.26% <100.00%> (+0.26%) 21.00 <0.00> (ø)

@caohdgege caohdgege closed this May 2, 2021
@caohdgege caohdgege reopened this May 2, 2021
@caohdgege caohdgege closed this May 2, 2021
@caohdgege caohdgege reopened this May 2, 2021
Copy link
Member

@xingfudeshi xingfudeshi left a comment

Choose a reason for hiding this comment

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

LGTM.

@funky-eyes funky-eyes merged commit 0e98040 into apache:develop May 3, 2021
@caohdgege caohdgege deleted the optimize-build-lockkeys branch May 11, 2021 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants