planner: implement the BatchPointGetPlan to improve the BatchPointGet performance#12322
planner: implement the BatchPointGetPlan to improve the BatchPointGet performance#12322sre-bot merged 18 commits intopingcap:masterfrom lonng:batch-point-get-plan
Conversation
|
/bench |
|
@ngaut This PR just improve the The following benchmark test on my local laptop. |
|
@lonng |
|
@coocood |
@@ Benchmark Diff @@
================================================================================
--- tidb: 46113838b5b97a8cdb1fdaa4a6ef44ffdff2ec36
+++ tidb: e5681701c31102fe34533a2e3feec5c99ea0a208
tikv: 6ecea793538ee260b26e84ee3370807ecd591d21
pd: 5c648dc365e0025c4b7c4544bc2c593fe5c76c0b
================================================================================
test-1: < oltp_read_write >
* QPS : 37173.59 ± 0.5584% (std=158.52) delta: 0.65%
* AvgMs : 138.19 ± 0.4950% (std=0.54) delta: -0.63%
* PercentileMs99 : 269.35 ± 1.0826% (std=2.38) delta: 0.73%
test-2: < oltp_point_select >
* QPS : 80815.46 ± 2.0336% (std=932.52) delta: 0.73%
* AvgMs : 3.16 ± 2.0860% (std=0.04) delta: -0.13%
* PercentileMs99 : 6.77 ± 2.1283% (std=0.09) delta: 1.44%
test-3: < oltp_insert >
* QPS : 21765.89 ± 1.1936% (std=187.45) delta: -0.49%
* AvgMs : 11.76 ± 1.2249% (std=0.10) delta: 0.50%
* PercentileMs99 : 24.38 ± 0.0000% (std=0.00) delta: 2.90%
test-4: < oltp_update_index >
* QPS : 17031.11 ± 0.7484% (std=105.37) delta: -0.48%
* AvgMs : 14.89 ± 0.3628% (std=0.04) delta: 0.24%
* PercentileMs99 : 31.03 ± 1.0827% (std=0.27) delta: 2.56%
test-5: < oltp_update_non_index >
* QPS : 29148.38 ± 0.4211% (std=97.11) delta: 0.11%
* AvgMs : 8.78 ± 0.4556% (std=0.03) delta: -0.11%
* PercentileMs99 : 19.09 ± 1.0688% (std=0.17) delta: 2.56%
|
Codecov Report
@@ Coverage Diff @@
## master #12322 +/- ##
================================================
- Coverage 80.0317% 79.9846% -0.0471%
================================================
Files 460 462 +2
Lines 103915 103171 -744
================================================
- Hits 83165 82521 -644
- Misses 14714 14758 +44
+ Partials 6036 5892 -144 |
|
/run-all-tests |
planner/core/point_get_plan.go
Outdated
There was a problem hiding this comment.
Shall we use physicalSchemaProducer instead of baseSchemaProducer to avoid unnecessary function overload such as StatsCount() below?
There was a problem hiding this comment.
The physicalSchemaProducer contains some unnecessary fields.
There was a problem hiding this comment.
But BatchPointGetPlan is actually a physical plan indeed?
There was a problem hiding this comment.
To make the BatchPointGetPlan struct size small, prefer to keep the current implementation (the same as PointGetPlan).
… performance Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
|
/run-all-tests |
Signed-off-by: Lonng <heng@lonng.org>
Signed-off-by: Lonng <heng@lonng.org>
|
@eurekaka @lamxTyler PTAL again. |
|
/run-all-tests |





Signed-off-by: Lonng heng@lonng.org
What problem does this PR solve?
The
SELECT * FROM t WEHRE (a, b) in ((1,2), (2,3))will be transformedBatchPointGetExecto improve performance if the(a, b)is an unique index (#11750). But reuse theUnionAllphysical plan, to archive this goal is not an efficiency implementation because it will calltryPointGetmany times.What is changed and how it works?
This PR implements an individual plan
BatchPointGetPlanto improve this situation.Check List
Tests
Code changes
Side effects
Release note