Commit Graph

126 Commits

Author SHA1 Message Date
f388b094df planner: add optimizer hint TOPN_TO_COP() (#19545)
* planner: add TopN_To_Cop hint.

* go fmt.

* add a method canPushToCop() to check if it is valid to push the TopN down.

* add unit test case for warning.

* gofmt.

Co-authored-by: Yuanjia Zhang <zhangyuanjia@pingcap.com>
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2020-09-10 17:18:20 +08:00
1cab3d5947 *: fix bug of same type plans with different plan digest (#19519) 2020-09-01 21:55:20 +08:00
b78f4896fe statistics, util/ranger: improve selectivity calculation for DNF filters (#18741) 2020-08-27 15:40:12 +08:00
e52cb3714e planner: Do not pushdown unsupported function to tiflash in TopN operator (#19363)
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2020-08-25 17:20:18 +08:00
84e07a2a59 planner: propagate NDV of column groups across plan nodes (#17854) 2020-08-12 16:39:11 +08:00
3b35c89958 util/ranger: fix explain does not display range[NULL, NULL] (#19028) (#19068) 2020-08-11 17:23:01 +08:00
f172a1e08a planner: make some access paths check fit the clustered index (#18998)
* planner: make some access paths check fit the clustered index

* add test

* add test for outer join elimination

* make test stable

* fix test

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2020-08-10 15:33:17 +08:00
3df573d2fc planner,executor: use new table partition implementation and fix CI (#18981) 2020-08-06 17:50:40 +08:00
e49b4c0322 planner: support out join in broadcast join (#18988)
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
Co-authored-by: Zhuomin(Charming) Liu <lzmhhh123@gmail.com>
2020-08-06 13:24:17 +08:00
aeee1524e4 planner: fix the inappropriate heuristic rule to estimate the EQ selectivity when out of range (#18543) 2020-08-05 14:11:06 +08:00
4e829aaee7 planner,executor: fix index merge for partition table (#18940)
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2020-08-04 20:38:17 +08:00
950ca5062c plan: optimize the performance of decodePlan for big union query (#18891) 2020-08-03 14:17:36 +08:00
5dd7cd8553 planner/core: implement Explain for the new partition table (#18834)
Co-authored-by: lysu <sulifx@gmail.com>
2020-07-30 15:37:02 +08:00
56fd348d20 executor: support index merge on cluster index (#18699)
* executor: support index merge on cluster index

* fix fmt

* fix

* fix

* fix

* fix

* address comments

* address comments

* address comments

* fix

* fix

* fix

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2020-07-27 18:09:32 +08:00
f3554241bb planner, executor: support except and intersect set operator (#18459)
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2020-07-27 17:56:07 +08:00
29178dfa8d planner, executor: support broadcast join for tiflash engine. (#17232)
* support batch cop for tiflash

* support batch cop

* support join push down to tiflash

* refine

* change pb

* push join

* fix

* add hint

* refine hint

* add ranges

* fix

* fix

* fix push down

* fix index

* enable distsql for join

* add a session var to disable/enable broadcast join

* fix bug

* fix bug

* tiny fix

* enable cast decimal pushdown to tiflash

* fix

* fix bc join bug

* make broadcast plan stable

* refine code

* fix bug

* basic support for multi table broadcast join

* fix bug

* basic cbo for broadcast join

* improve

* fix bug

* remote useless code

* add tests

* pass unit tests

* refine code

* support execute summary info for broadcast join

* fix bug in explain for broadcast join

* format code

* remove un-needed code

* fix make dev

* address comments

* Hanfei/join merge (#7)

* enable exec details for batch cop

* format code

* fix test

* change tidb_opt_broadcast_join to global vars

* Ban cartesian join to be pushed down to TiFlash (#8)

* merge master (#10)

* merge master

* fix bug

* fix bug

* fix ut

* check session var conflict

* Add perfer local hint for broadcast join (#12)

* update

* remove useless code

* remove useless code

* update parser

* add test for prefer local join

* use bcj_local

* update go.mod

* refine planner

* refine comments

* fix make dev

* fix make dev

* update parser

* address comments

* fix make dev

* disable broadcast join when new collation is enabled

* Update planner/core/exhaust_physical_plans.go

Co-authored-by: Zhuomin(Charming) Liu <lzmhhh123@gmail.com>

* address comments

* fix

* address comments

* fix tests

* address comments

Co-authored-by: xufei <xufeixw@mail.ustc.edu.cn>
Co-authored-by: xufei <xufei@pingcap.com>
Co-authored-by: 虎 <ichneumon.hu@foxmail.com>
Co-authored-by: Zhuomin(Charming) Liu <lzmhhh123@gmail.com>
2020-07-27 12:41:36 +08:00
ace80c7411 planner: apply min-max eliminator on common handle columns (#18589)
* planner: apply min-max eliminator on common handle columns

* reuse AccessPath.IsTablePath()

* planner: apply min-max eliminator on common handle columns

* address comments

* address comment

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
2020-07-17 18:01:47 +08:00
79143d6fa1 planner: support keep order for clustered index (#18590) 2020-07-16 12:01:06 +08:00
af129d2116 planner: reset plan ID count when using nth_plan hint (#18409) 2020-07-10 09:46:34 +08:00
658132fcf3 planner: refactor handle columns (#18391) 2020-07-07 12:26:14 +08:00
daad2699dd *: support clustered index for index join (#18204) 2020-07-01 16:15:51 +08:00
dce0e45bdf planner, add hint nth_plan(x) to help user force a plan (#17850) 2020-07-01 15:34:22 +08:00
5250f7f53f *: support clustered index in double read (#18127) 2020-06-23 15:33:38 +08:00
3e5db05ac0 planner: support specify table partition in optimize hint (#17638)
Co-authored-by: HuaiyuXu <391585975@qq.com>
2020-06-22 11:21:23 +08:00
978370f7cb executor: add new agg function APPROX_COUNT_DISTINCT (#17175) 2020-06-18 22:00:14 +08:00
463d085342 planner: check clustered index don't need double read (#18054) 2020-06-17 14:37:21 +08:00
7f1cd1a60d planner: support build clustered index range for table scan (#18018) 2020-06-16 11:49:01 +08:00
06361c2d98 expression: fix type infer error for count (#17871) 2020-06-11 10:22:54 +08:00
8189c4af83 planner: isolation read do not filter system tables (#17556) 2020-06-05 17:12:27 +08:00
94a722e2df statistics: improve estimation for index equal condition (#17366) 2020-06-03 08:32:17 +08:00
777907bcee planner: push agg below partition union all by default (#17262) 2020-05-28 18:11:13 +08:00
38298c2e3e planner: fix wrong index merge join plan for join key is not the prefix of index (#16894) 2020-05-22 17:40:10 +08:00
134e691d6f planner: check required order property for enforced stream aggregation (#17338) 2020-05-21 23:47:55 +08:00
b248783dfe planner: fix wrong agg function when agg push down union (#17022) 2020-05-20 21:50:15 +08:00
3afb631ef6 planner/core: support range partition pruning for 'in' expression (#17210) 2020-05-20 19:27:14 +08:00
e8779717d9 planner, expression: Remove the default asc order in explain result (#17074) 2020-05-14 17:38:19 +08:00
7ebcc20398 executor: support GROUP_CONCAT(ORDER BY) (#16591) 2020-05-06 18:41:22 +08:00
76b910edd1 planner: hints for index merge should check the DB name for a table (#16519) 2020-04-29 15:46:56 +08:00
902231076d planner: move flagPrunColumnsAgain so that UPDATE statement ca… (#16785) 2020-04-24 18:58:51 +08:00
b6fcc15744 planner: enforce the required property when hint cannot satisf… (#15650) 2020-04-22 14:26:20 +08:00
b8494e7a11 expression: support disable expression pushdown based on store… (#16389) 2020-04-17 14:53:25 +08:00
637d3b8a44 planner: only push count distinct when child is DataSouce (#16371) 2020-04-16 13:04:33 +08:00
8f000fc353 planner: push avg & distinct functions across union (#16344) 2020-04-15 18:07:37 +08:00
d26875db7e expression: fix error PushDownNot for contiguous NOT (#16108) 2020-04-15 17:52:14 +08:00
c66320c464 planner: fix panic when two table scan as the build side for i… (#16001) 2020-04-14 18:22:43 +08:00
49ee75a0a5 planner, executor: enable inline projection for merge join (#15463) 2020-04-09 15:58:32 +08:00
a69e7da69b util/hint: resolve semantically equivalent bindings into a single one (#15895) 2020-04-03 17:27:57 +08:00
f572c8efc5 planner: add warning when use_index_merge hint's index names are invalid (#15960) 2020-04-03 11:33:38 +08:00
77f970c48c planner: fix push down distinct when need to inject projection (#15997) 2020-04-02 11:43:01 +08:00
4eb9ca3d3f planner: push aggregation functions with distinct to cop (#15500) 2020-04-01 20:49:14 +08:00