Skip to content

Conversation

@boyjoy1127
Copy link
Contributor

Ref #19937

Changes proposed in this pull request:

  • add plan cache.
  • fix conflicts when merging code from master.

@boyjoy1127 boyjoy1127 changed the title fix: fix conflicts when merge code from master. Add optimized plan cache. Sep 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2022

Codecov Report

Merging #21149 (e927d6e) into master (ed8429d) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

@@             Coverage Diff              @@
##             master   #21149      +/-   ##
============================================
- Coverage     61.64%   61.62%   -0.03%     
  Complexity     2487     2487              
============================================
  Files          4062     4063       +1     
  Lines         55891    55913      +22     
  Branches       9440     9442       +2     
============================================
- Hits          34456    34455       -1     
- Misses        18559    18582      +23     
  Partials       2876     2876              
Impacted Files Coverage Δ
...ration/advanced/AdvancedSQLFederationExecutor.java 21.27% <0.00%> (-2.54%) ⬇️
...lfederation/optimizer/OptimizedPlanManagement.java 0.00% <0.00%> (ø)
...ere/sqlfederation/optimizer/SQLOptimizeEngine.java 100.00% <ø> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

}

private Cache<String, SQLOptimizeContext> buildCache() {
return CacheBuilder.newBuilder()
Copy link
Member

Choose a reason for hiding this comment

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

How about using Caffeine cache?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why use Caffine cache, does it have any benefits? @TeslaCN

Copy link
Member

Choose a reason for hiding this comment

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

  • The performance of Caffeine is better than Guava in most scenario.
  • And ShardingSphere is reducing usage of Guava.

The SQL parser cache has been migrated to Caffeine in #17712.

@boyjoy1127 boyjoy1127 closed this Sep 25, 2022
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