Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into sort
Browse files Browse the repository at this point in the history
  • Loading branch information
wshwsh12 committed Dec 17, 2019
2 parents b9f5795 + a61e3cc commit 6561f68
Show file tree
Hide file tree
Showing 368 changed files with 72,487 additions and 4,665 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/expression @pingcap/co-expression
/planner @pingcap/co-planner
/statistics @pingcap/co-planner
/util/ranger @pingcap/co-planner
/bindinfo @pingcap/co-planner
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Contributor list is moved to [Contributors](https://github.com/pingcap/community/blob/master/contributors#tidb-contributors)
Contributor list is moved to [Contributors](https://github.com/pingcap/community/blob/master/architecture/contributor-list.md#tidb-contributors)
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
PROJECT=tidb
GOPATH ?= $(shell go env GOPATH)
P=8

# Ensure GOPATH is set before running build process.
ifeq "$(GOPATH)" ""
Expand All @@ -14,7 +15,7 @@ export PATH := $(path_to_add):$(PATH)
GO := GO111MODULE=on go
GOBUILD := $(GO) build $(BUILD_FLAG) -tags codes
GOBUILDCOVERAGE := GOPATH=$(GOPATH) cd tidb-server; $(GO) test -coverpkg="../..." -c .
GOTEST := $(GO) test -p 8
GOTEST := $(GO) test -p $(P)
OVERALLS := GO111MODULE=on overalls

ARCH := "`uname -s`"
Expand Down Expand Up @@ -82,13 +83,10 @@ goword:tools/bin/goword
gosec:tools/bin/gosec
tools/bin/gosec $$($(PACKAGE_DIRECTORIES))

check-static:tools/bin/gometalinter tools/bin/misspell tools/bin/ineffassign
@ # TODO: enable megacheck.
@ # TODO: gometalinter has been DEPRECATED.
@ # https://github.com/alecthomas/gometalinter/issues/590
tools/bin/gometalinter --disable-all --deadline 120s \
--enable misspell \
--enable ineffassign \
check-static: tools/bin/golangci-lint
tools/bin/golangci-lint run -v --disable-all --deadline=3m \
--enable=misspell \
--enable=ineffassign \
$$($(PACKAGE_DIRECTORIES))

check-slow:tools/bin/gometalinter tools/bin/gosec
Expand Down Expand Up @@ -276,6 +274,8 @@ tools/bin/misspell:tools/check/go.mod
tools/bin/ineffassign:tools/check/go.mod
cd tools/check; \
$(GO) build -o ../bin/ineffassign github.com/gordonklaus/ineffassign
tools/bin/golangci-lint:
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b ./tools/bin v1.21.0

# Usage:
#
Expand Down
74 changes: 73 additions & 1 deletion bindinfo/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (s *testSuite) TestGlobalBinding(c *C) {
metrics.BindMemoryUsage.WithLabelValues(metrics.ScopeGlobal, bindinfo.Using).Write(pb)
c.Assert(pb.GetGauge().GetValue(), Equals, float64(121))

sql, hash := parser.NormalizeDigest("select * from t where i > ?")
sql, hash := parser.NormalizeDigest("select * from t where i > 30.0")

bindData := s.domain.BindHandle().GetBindRecord(hash, sql, "test")
c.Check(bindData, NotNil)
Expand Down Expand Up @@ -365,6 +365,43 @@ func (s *testSuite) TestExplain(c *C) {
tk.MustExec("drop global binding for SELECT * from t1,t2 where t1.id = t2.id")
}

// TestBindingSymbolList tests sql with "?, ?, ?, ?", fixes #13871
func (s *testSuite) TestBindingSymbolList(c *C) {
tk := testkit.NewTestKit(c, s.store)
s.cleanBindingEnv(tk)
tk.MustExec("use test")
tk.MustExec("drop table if exists t")
tk.MustExec("create table t(a int, b int, INDEX ia (a), INDEX ib (b));")
tk.MustExec("insert into t value(1, 1);")

// before binding
tk.MustQuery("select a, b from t where a = 3 limit 1, 100")
c.Assert(tk.Se.GetSessionVars().StmtCtx.IndexNames[0], Equals, "t:ia")
c.Assert(tk.MustUseIndex("select a, b from t where a = 3 limit 1, 100", "a"), IsTrue)

tk.MustExec(`create global binding for select a, b from t where a = 1 limit 0, 1 using select a, b from t use index (ib) where a = 1 limit 0, 1`)

// after binding
tk.MustQuery("select a, b from t where a = 3 limit 1, 100")
c.Assert(tk.Se.GetSessionVars().StmtCtx.IndexNames[0], Equals, "t:ib")
c.Assert(tk.MustUseIndex("select a, b from t where a = 3 limit 1, 100", "b"), IsTrue)

// Normalize
sql, hash := parser.NormalizeDigest("select a, b from t where a = 1 limit 0, 1")

bindData := s.domain.BindHandle().GetBindRecord(hash, sql, "test")
c.Assert(bindData, NotNil)
c.Check(bindData.OriginalSQL, Equals, "select a , b from t where a = ? limit ...")
bind := bindData.Bindings[0]
c.Check(bind.BindSQL, Equals, "select a, b from t use index (ib) where a = 1 limit 0, 1")
c.Check(bindData.Db, Equals, "test")
c.Check(bind.Status, Equals, "using")
c.Check(bind.Charset, NotNil)
c.Check(bind.Collation, NotNil)
c.Check(bind.CreateTime, NotNil)
c.Check(bind.UpdateTime, NotNil)
}

func (s *testSuite) TestErrorBind(c *C) {
tk := testkit.NewTestKit(c, s.store)
s.cleanBindingEnv(tk)
Expand Down Expand Up @@ -528,3 +565,38 @@ func (s *testSuite) TestAddEvolveTasks(c *C) {
status := rows[1][3].(string)
c.Assert(status == "using" || status == "rejected", IsTrue)
}

func (s *testSuite) TestBindingCache(c *C) {
tk := testkit.NewTestKit(c, s.store)
s.cleanBindingEnv(tk)
tk.MustExec("use test")
tk.MustExec("drop table if exists t")
tk.MustExec("create table t(a int, b int, index idx(a))")
tk.MustExec("create global binding for select * from t using select * from t use index(idx)")
tk.MustExec("create database tmp")
tk.MustExec("use tmp")
tk.MustExec("create table t(a int, b int, index idx(a))")
tk.MustExec("create global binding for select * from t using select * from t use index(idx)")

c.Assert(s.domain.BindHandle().Update(false), IsNil)
c.Assert(s.domain.BindHandle().Update(false), IsNil)
res := tk.MustQuery("show global bindings")
c.Assert(len(res.Rows()), Equals, 2)

tk.MustExec("drop global binding for select * from t")
c.Assert(s.domain.BindHandle().Update(false), IsNil)
c.Assert(len(s.domain.BindHandle().GetAllBindRecord()), Equals, 1)
}

func (s *testSuite) TestDefaultSessionVars(c *C) {
tk := testkit.NewTestKit(c, s.store)
s.cleanBindingEnv(tk)
tk.MustQuery(`show variables like "%baselines%"`).Sort().Check(testkit.Rows(
"tidb_capture_plan_baselines off",
"tidb_evolve_plan_baselines off",
"tidb_use_plan_baselines on"))
tk.MustQuery(`show global variables like "%baselines%"`).Sort().Check(testkit.Rows(
"tidb_capture_plan_baselines off",
"tidb_evolve_plan_baselines off",
"tidb_use_plan_baselines on"))
}
2 changes: 1 addition & 1 deletion bindinfo/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func (br *BindRecord) metrics() ([]float64, []int) {
sizes[statusIndex[br.Bindings[0].Status]] = commonLength
for _, binding := range br.Bindings {
sizes[statusIndex[binding.Status]] += binding.size()
count[statusIndex[binding.Status]] += 1
count[statusIndex[binding.Status]]++
}
return sizes, count
}
Expand Down
21 changes: 10 additions & 11 deletions bindinfo/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package bindinfo

import (
"context"
"errors"
"fmt"
"runtime"
"strconv"
Expand Down Expand Up @@ -126,7 +125,7 @@ func (h *BindHandle) Update(fullLoad bool) (err error) {

sql := "select original_sql, bind_sql, default_db, status, create_time, update_time, charset, collation from mysql.bind_info"
if !fullLoad {
sql += " where update_time >= \"" + lastUpdateTime.String() + "\""
sql += " where update_time > \"" + lastUpdateTime.String() + "\""
}
// We need to apply the updates by order, wrong apply order of same original sql may cause inconsistent state.
sql += " order by update_time"
Expand Down Expand Up @@ -154,7 +153,7 @@ func (h *BindHandle) Update(fullLoad bool) (err error) {
lastUpdateTime = meta.Bindings[0].UpdateTime
}
if err != nil {
logutil.BgLogger().Error("update bindinfo failed", zap.Error(err))
logutil.BgLogger().Info("update bindinfo failed", zap.Error(err))
continue
}

Expand All @@ -163,7 +162,7 @@ func (h *BindHandle) Update(fullLoad bool) (err error) {
if len(newRecord.Bindings) > 0 {
newCache.setBindRecord(hash, newRecord)
} else {
newCache.removeDeletedBindRecord(hash, oldRecord)
newCache.removeDeletedBindRecord(hash, newRecord)
}
updateMetrics(metrics.ScopeGlobal, oldRecord, newCache.getBindRecord(hash, meta.OriginalSQL, meta.Db), true)
}
Expand All @@ -177,7 +176,7 @@ func (h *BindHandle) AddBindRecord(sctx sessionctx.Context, is infoschema.InfoSc
return err
}

br := h.GetBindRecord(parser.DigestHash(record.OriginalSQL), record.OriginalSQL, record.Db)
br := h.GetBindRecord(parser.DigestNormalized(record.OriginalSQL), record.OriginalSQL, record.Db)
var duplicateBinding string
if br != nil {
binding := br.FindBinding(record.Bindings[0].id)
Expand Down Expand Up @@ -216,7 +215,7 @@ func (h *BindHandle) AddBindRecord(sctx sessionctx.Context, is infoschema.InfoSc
// Make sure there is only one goroutine writes the cache and use parser.
h.bindInfo.Lock()
// update the BindRecord to the cache.
h.appendBindRecord(parser.DigestHash(record.OriginalSQL), record)
h.appendBindRecord(parser.DigestNormalized(record.OriginalSQL), record)
h.bindInfo.Unlock()
}()

Expand Down Expand Up @@ -277,7 +276,7 @@ func (h *BindHandle) DropBindRecord(sctx sessionctx.Context, is infoschema.InfoS
return
}

err = h.removeBindRecord(parser.DigestHash(record.OriginalSQL), record)
err = h.removeBindRecord(parser.DigestNormalized(record.OriginalSQL), record)
}()

txn, err1 := h.sctx.Context.Txn(true)
Expand All @@ -290,7 +289,7 @@ func (h *BindHandle) DropBindRecord(sctx sessionctx.Context, is infoschema.InfoS
Type: mysql.TypeDatetime,
Fsp: 3,
}
oldBindRecord := h.GetBindRecord(parser.DigestHash(record.OriginalSQL), record.OriginalSQL, record.Db)
oldBindRecord := h.GetBindRecord(parser.DigestNormalized(record.OriginalSQL), record.OriginalSQL, record.Db)
bindingSQLs := make([]string, 0, len(record.Bindings))
for i := range record.Bindings {
record.Bindings[i].Status = deleted
Expand Down Expand Up @@ -401,7 +400,7 @@ func (h *BindHandle) newBindRecord(row chunk.Row) (string, *BindRecord, error) {
Db: row.GetString(2),
Bindings: []Binding{hint},
}
hash := parser.DigestHash(bindRecord.OriginalSQL)
hash := parser.DigestNormalized(bindRecord.OriginalSQL)
h.sctx.Lock()
defer h.sctx.Unlock()
err := h.sctx.RefreshTxnCtx(context.TODO())
Expand Down Expand Up @@ -459,6 +458,7 @@ func (c cache) removeDeletedBindRecord(hash string, meta *BindRecord) {
}
}
}
c[hash] = metas
}

func (c cache) setBindRecord(hash string, meta *BindRecord) {
Expand Down Expand Up @@ -492,7 +492,6 @@ func copyBindRecordUpdateMap(oldMap map[string]*bindRecordUpdate) map[string]*bi

func (c cache) getBindRecord(hash, normdOrigSQL, db string) *BindRecord {
bindRecords := c[hash]

for _, bindRecord := range bindRecords {
if bindRecord.OriginalSQL == normdOrigSQL && bindRecord.Db == db {
return bindRecord
Expand Down Expand Up @@ -703,7 +702,7 @@ func runSQL(ctx context.Context, sctx sessionctx.Context, sql string, resultChan
buf := make([]byte, 4096)
stackSize := runtime.Stack(buf, false)
buf = buf[:stackSize]
resultChan <- errors.New(fmt.Sprintf("run sql panicked: %v", string(buf)))
resultChan <- fmt.Errorf("run sql panicked: %v", string(buf))
}
}()
recordSets, err := sctx.(sqlexec.SQLExecutor).Execute(ctx, sql)
Expand Down
7 changes: 3 additions & 4 deletions bindinfo/session_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (h *SessionHandle) AddBindRecord(sctx sessionctx.Context, is infoschema.Inf
err := record.prepareHints(sctx, is)
// update the BindMeta to the cache.
if err == nil {
h.appendBindRecord(parser.DigestHash(record.OriginalSQL), record)
h.appendBindRecord(parser.DigestNormalized(record.OriginalSQL), record)
}
return err
}
Expand All @@ -79,16 +79,15 @@ func (h *SessionHandle) DropBindRecord(sctx sessionctx.Context, is infoschema.In
} else {
newRecord = record
}
h.ch.setBindRecord(parser.DigestHash(record.OriginalSQL), newRecord)
h.ch.setBindRecord(parser.DigestNormalized(record.OriginalSQL), newRecord)
updateMetrics(metrics.ScopeSession, oldRecord, newRecord, false)
return nil
}

// GetBindRecord return the BindMeta of the (normdOrigSQL,db) if BindMeta exist.
func (h *SessionHandle) GetBindRecord(normdOrigSQL, db string) *BindRecord {
hash := parser.DigestHash(normdOrigSQL)
hash := parser.DigestNormalized(normdOrigSQL)
bindRecords := h.ch[hash]

for _, bindRecord := range bindRecords {
if bindRecord.OriginalSQL == normdOrigSQL && bindRecord.Db == db {
return bindRecord
Expand Down
2 changes: 1 addition & 1 deletion checkout-pr-branch.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# This script is used to checkout a TiDB PR branch in a forked repo.
if test -z $1; then
Expand Down
15 changes: 15 additions & 0 deletions cmd/explaintest/r/access_tiflash.result
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,18 @@ id count task operator info
TableReader_7 44.00 root data:Selection_6
└─Selection_6 44.00 cop[tiflash] or(and(gt(test.tt.a, 1), lt(test.tt.a, 20)), and(ge(test.tt.a, 30), lt(test.tt.a, 55)))
└─TableScan_5 44.00 cop[tiflash] table:tt, range:[-inf,+inf], keep order:false, stats:pseudo
drop table if exists ttt;
create table ttt (a int, primary key (a desc));
desc select * from ttt order by ttt.a desc;
id count task operator info
TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop[tikv] table:ttt, range:[-inf,+inf], keep order:true, desc, stats:pseudo
desc select /*+ read_from_storage(tiflash[ttt]) */ * from ttt order by ttt.a desc;
id count task operator info
Sort_4 10000.00 root test.ttt.a:desc
└─TableReader_8 10000.00 root data:TableScan_7
└─TableScan_7 10000.00 cop[tiflash] table:ttt, range:[-inf,+inf], keep order:false, stats:pseudo
desc select /*+ read_from_storage(tiflash[ttt]) */ * from ttt order by ttt.a;
id count task operator info
TableReader_11 10000.00 root data:TableScan_10
└─TableScan_10 10000.00 cop[tiflash] table:ttt, range:[-inf,+inf], keep order:true, stats:pseudo
26 changes: 13 additions & 13 deletions cmd/explaintest/r/explain_complex.result
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ Projection_13 1.00 root test.st.id, test.dd.id, test.st.aid, test.st.cm, test.dd
└─HashAgg_19 1.00 root group by:test.dd.dic, test.st.aid, funcs:firstrow(test.st.id)->test.st.id, funcs:firstrow(test.st.aid)->test.st.aid, funcs:firstrow(test.st.cm)->test.st.cm, funcs:firstrow(test.st.p1)->test.st.p1, funcs:firstrow(test.st.p2)->test.st.p2, funcs:firstrow(test.st.p3)->test.st.p3, funcs:firstrow(test.st.p4)->test.st.p4, funcs:firstrow(test.st.p5)->test.st.p5, funcs:firstrow(test.st.p6_md5)->test.st.p6_md5, funcs:firstrow(test.st.p7_md5)->test.st.p7_md5, funcs:firstrow(test.st.ext)->test.st.ext, funcs:firstrow(test.st.t)->test.st.t, funcs:firstrow(test.dd.id)->test.dd.id, funcs:firstrow(test.dd.dic)->test.dd.dic, funcs:firstrow(test.dd.ip)->test.dd.ip, funcs:firstrow(test.dd.t)->test.dd.t
└─IndexMergeJoin_30 0.00 root inner join, inner:IndexLookUp_28, outer key:test.st.aid, inner key:test.dd.aid, other cond:eq(test.dd.ip, test.st.ip), gt(test.dd.t, test.st.t)
├─IndexLookUp_28 0.00 root
│ ├─IndexScan_25 0.00 cop[tikv] table:dd, index:aid, dic, range: decided by [eq(test.dd.aid, test.st.aid)], keep order:true, stats:pseudo
│ ├─IndexScan_25 1.00 cop[tikv] table:dd, index:aid, dic, range: decided by [eq(test.dd.aid, test.st.aid)], keep order:true, stats:pseudo
│ └─Selection_27 0.00 cop[tikv] eq(test.dd.bm, 0), eq(test.dd.pt, "android"), gt(test.dd.t, 1478143908), not(isnull(test.dd.ip)), not(isnull(test.dd.t))
│ └─TableScan_26 0.00 cop[tikv] table:dd, keep order:false, stats:pseudo
│ └─TableScan_26 1.00 cop[tikv] table:dd, keep order:false, stats:pseudo
└─IndexLookUp_41 3.33 root
├─IndexScan_38 3333.33 cop[tikv] table:gad, index:t, range:(1478143908,+inf], keep order:false, stats:pseudo
└─Selection_40 3.33 cop[tikv] eq(test.st.pt, "android"), not(isnull(test.st.ip))
Expand All @@ -137,9 +137,9 @@ Projection_10 0.00 root test.st.id, test.dd.id, test.st.aid, test.st.cm, test.dd
│ └─Selection_34 0.00 cop[tikv] eq(test.st.bm, 0), eq(test.st.dit, "mac"), eq(test.st.pt, "ios"), not(isnull(test.st.dic))
│ └─TableScan_33 3333.33 cop[tikv] table:gad, keep order:false, stats:pseudo
└─IndexLookUp_22 0.00 root
├─IndexScan_19 0.00 cop[tikv] table:sdk, index:aid, dic, range: decided by [eq(test.dd.aid, test.st.aid)], keep order:true, stats:pseudo
├─IndexScan_19 1.00 cop[tikv] table:sdk, index:aid, dic, range: decided by [eq(test.dd.aid, test.st.aid)], keep order:true, stats:pseudo
└─Selection_21 0.00 cop[tikv] eq(test.dd.bm, 0), eq(test.dd.pt, "ios"), gt(test.dd.t, 1477971479), not(isnull(test.dd.mac)), not(isnull(test.dd.t))
└─TableScan_20 0.00 cop[tikv] table:sdk, keep order:false, stats:pseudo
└─TableScan_20 1.00 cop[tikv] table:sdk, keep order:false, stats:pseudo
explain SELECT cm, p1, p2, p3, p4, p5, p6_md5, p7_md5, count(1) as click_pv, count(DISTINCT ip) as click_ip FROM st WHERE (t between 1478188800 and 1478275200) and aid='cn.sbkcq' and pt='android' GROUP BY cm, p1, p2, p3, p4, p5, p6_md5, p7_md5;
id count task operator info
Projection_5 1.00 root test.st.cm, test.st.p1, test.st.p2, test.st.p3, test.st.p4, test.st.p5, test.st.p6_md5, test.st.p7_md5, Column#20, Column#21
Expand All @@ -156,10 +156,10 @@ Projection_10 0.00 root test.dt.id, test.dt.aid, test.dt.pt, test.dt.dic, test.d
├─TableReader_43 0.00 root data:Selection_42
│ └─Selection_42 0.00 cop[tikv] eq(test.dt.bm, 0), eq(test.dt.pt, "ios"), gt(test.dt.t, 1478185592), not(isnull(test.dt.dic))
│ └─TableScan_41 10000.00 cop[tikv] table:dt, range:[0,+inf], keep order:false, stats:pseudo
└─IndexLookUp_18 0.00 root
├─IndexScan_15 1.25 cop[tikv] table:rr, index:aid, dic, range: decided by [eq(test.rr.aid, test.dt.aid) eq(test.rr.dic, test.dt.dic)], keep order:false, stats:pseudo
└─Selection_17 0.00 cop[tikv] eq(test.rr.pt, "ios"), gt(test.rr.t, 1478185592)
└─TableScan_16 1.25 cop[tikv] table:rr, keep order:false, stats:pseudo
└─IndexLookUp_18 1.00 root
├─IndexScan_15 1.00 cop[tikv] table:rr, index:aid, dic, range: decided by [eq(test.rr.aid, test.dt.aid) eq(test.rr.dic, test.dt.dic)], keep order:false, stats:pseudo
└─Selection_17 1.00 cop[tikv] eq(test.rr.pt, "ios"), gt(test.rr.t, 1478185592)
└─TableScan_16 1.00 cop[tikv] table:rr, keep order:false, stats:pseudo
explain select pc,cr,count(DISTINCT uid) as pay_users,count(oid) as pay_times,sum(am) as am from pp where ps=2 and ppt>=1478188800 and ppt<1478275200 and pi in ('510017','520017') and uid in ('18089709','18090780') group by pc,cr;
id count task operator info
Projection_5 1.00 root test.pp.pc, test.pp.cr, Column#22, Column#23, Column#24
Expand Down Expand Up @@ -251,11 +251,11 @@ Sort_10 1.00 root test.org_department.left_value:asc
│ │ ├─IndexScan_59 10.00 cop[tikv] table:d, index:ctx, range:[1,1], keep order:false, stats:pseudo
│ │ └─Selection_61 0.01 cop[tikv] eq(test.org_department.status, 1000)
│ │ └─TableScan_60 10.00 cop[tikv] table:d, keep order:false, stats:pseudo
│ └─IndexLookUp_38 0.00 root
│ ├─Selection_36 1.25 cop[tikv] not(isnull(test.org_position.department_id))
│ │ └─IndexScan_34 1.25 cop[tikv] table:p, index:department_id, range: decided by [eq(test.org_position.department_id, test.org_department.id)], keep order:true, stats:pseudo
│ └─Selection_37 0.00 cop[tikv] eq(test.org_position.status, 1000)
│ └─TableScan_35 1.25 cop[tikv] table:p, keep order:false, stats:pseudo
│ └─IndexLookUp_38 1.25 root
│ ├─Selection_36 1250.00 cop[tikv] not(isnull(test.org_position.department_id))
│ │ └─IndexScan_34 1251.25 cop[tikv] table:p, index:department_id, range: decided by [eq(test.org_position.department_id, test.org_department.id)], keep order:true, stats:pseudo
│ └─Selection_37 1.25 cop[tikv] eq(test.org_position.status, 1000)
│ └─TableScan_35 1250.00 cop[tikv] table:p, keep order:false, stats:pseudo
└─TableReader_72 9.99 root data:Selection_71
└─Selection_71 9.99 cop[tikv] eq(test.org_employee_position.status, 1000), not(isnull(test.org_employee_position.position_id))
└─TableScan_70 10000.00 cop[tikv] table:ep, range:[-inf,+inf], keep order:false, stats:pseudo
Loading

0 comments on commit 6561f68

Please sign in to comment.