Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/executor/explainfor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func TestExplainDotForQuery(t *testing.T) {
tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps})

tk2.MustQuery("explain format=\"dot\" select 1").Check(testkit.Rows(
"\ndigraph Projection_3 {\nsubgraph cluster3{\nnode [style=filled, color=lightgrey]\ncolor=black\nlabel = \"root\"\n\"Projection_3\" -> \"TableDual_5\"\n}\n}\n",
"\ndigraph Projection_3 {\nsubgraph cluster3{\nnode [style=filled, color=lightgrey]\ncolor=black\nlabel = \"root\"\n\"Projection_3\" -> \"TableDual_4\"\n}\n}\n",
))
err := tk.ExecToErr(fmt.Sprintf("explain format=\"dot\" for connection %s", connID))
require.Error(t, err)
Expand Down
8 changes: 5 additions & 3 deletions pkg/executor/partition_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ func TestPartitionInfoDisable(t *testing.T) {
tbInfo.Partition.Num = 0

tk.MustExec("set @@tidb_partition_prune_mode = 'static'")
tk.MustQuery("explain select * from t_info_null where (date = '2020-10-02' or date = '2020-10-06') and app = 'xxx' and media = '19003006'").Check(testkit.Rows("Batch_Point_Get_6 2.00 root table:t_info_null, index:idx_media_id(media, date, app) keep order:false, desc:false"))
tk.MustQuery("explain select * from t_info_null").Check(testkit.Rows("TableReader_6 10000.00 root data:TableFullScan_5",
"└─TableFullScan_5 10000.00 cop[tikv] table:t_info_null keep order:false, stats:pseudo"))
tk.MustQuery("explain select * from t_info_null where (date = '2020-10-02' or date = '2020-10-06') and app = 'xxx' and media = '19003006'").Check(testkit.Rows(
"Batch_Point_Get_5 2.00 root table:t_info_null, index:idx_media_id(media, date, app) keep order:false, desc:false"))
tk.MustQuery("explain select * from t_info_null").Check(testkit.Rows(
"TableReader_5 10000.00 root data:TableFullScan_4",
"└─TableFullScan_4 10000.00 cop[tikv] table:t_info_null keep order:false, stats:pseudo"))
// No panic.
tk.MustQuery("select * from t_info_null where (date = '2020-10-02' or date = '2020-10-06') and app = 'xxx' and media = '19003006'").Check(testkit.Rows())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,10 @@ func TestIndexMergeReaderIssue45279(t *testing.T) {
tk.MustExec("CREATE TABLE reproduce (c1 int primary key, c2 int, c3 int, key ci2(c2), key ci3(c3));")
tk.MustExec("insert into reproduce values (1, 1, 1), (2, 2, 2), (3, 3, 3);")
tk.MustQuery("explain select * from reproduce where c1 in (0, 1, 2, 3) or c2 in (0, 1, 2);").Check(testkit.Rows(
"IndexMerge_12 33.99 root type: union",
"├─TableRangeScan_9(Build) 4.00 cop[tikv] table:reproduce range:[0,0], [1,1], [2,2], [3,3], keep order:false, stats:pseudo",
"├─IndexRangeScan_10(Build) 30.00 cop[tikv] table:reproduce, index:ci2(c2) range:[0,0], [1,1], [2,2], keep order:false, stats:pseudo",
"└─TableRowIDScan_11(Probe) 33.99 cop[tikv] table:reproduce keep order:false, stats:pseudo"))
"IndexMerge_11 33.99 root type: union",
"├─TableRangeScan_8(Build) 4.00 cop[tikv] table:reproduce range:[0,0], [1,1], [2,2], [3,3], keep order:false, stats:pseudo",
"├─IndexRangeScan_9(Build) 30.00 cop[tikv] table:reproduce, index:ci2(c2) range:[0,0], [1,1], [2,2], keep order:false, stats:pseudo",
"└─TableRowIDScan_10(Probe) 33.99 cop[tikv] table:reproduce keep order:false, stats:pseudo"))

// This function should return successfully
var ctx context.Context
Expand Down
2 changes: 1 addition & 1 deletion pkg/expression/integration_test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ go_test(
"//pkg/planner/core/operator/logicalop",
"//pkg/planner/core/resolve",
"//pkg/session",
"//pkg/session/sessmgr",
"//pkg/sessionctx/vardef",
"//pkg/sessionctx/variable",
"//pkg/store/mockstore",
Expand All @@ -36,7 +37,6 @@ go_test(
"//pkg/types",
"//pkg/util/codec",
"//pkg/util/collate",
"//pkg/util/plancodec",
"//pkg/util/sem",
"//pkg/util/timeutil",
"//pkg/util/versioninfo",
Expand Down
29 changes: 12 additions & 17 deletions pkg/expression/integration_test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import (
"github.com/pingcap/tidb/pkg/planner/core/operator/logicalop"
"github.com/pingcap/tidb/pkg/planner/core/resolve"
"github.com/pingcap/tidb/pkg/session"
"github.com/pingcap/tidb/pkg/session/sessmgr"
"github.com/pingcap/tidb/pkg/sessionctx/vardef"
"github.com/pingcap/tidb/pkg/sessionctx/variable"
"github.com/pingcap/tidb/pkg/store/mockstore"
Expand All @@ -55,7 +56,6 @@ import (
"github.com/pingcap/tidb/pkg/types"
"github.com/pingcap/tidb/pkg/util/codec"
"github.com/pingcap/tidb/pkg/util/collate"
"github.com/pingcap/tidb/pkg/util/plancodec"
"github.com/pingcap/tidb/pkg/util/sem"
"github.com/pingcap/tidb/pkg/util/versioninfo"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -671,24 +671,19 @@ func TestVectorConstantExplain(t *testing.T) {

stmtID, _, _, err := tk.Session().PrepareStmt("SELECT VEC_COSINE_DISTANCE(c, ?) FROM t")
require.Nil(t, err)
rs, err := tk.Session().ExecutePreparedStmt(context.Background(), stmtID, expression.Args2Expressions4Test(vb.String()))
_, err = tk.Session().ExecutePreparedStmt(context.Background(), stmtID, expression.Args2Expressions4Test(vb.String()))
require.NoError(t, err)

p, ok := tk.Session().GetSessionVars().StmtCtx.GetPlan().(base.Plan)
require.True(t, ok)

flat := plannercore.FlattenPhysicalPlan(p, true)
encodedPlanTree := plannercore.EncodeFlatPlan(flat)
planTree, err := plancodec.DecodePlan(encodedPlanTree)
require.NoError(t, err)
fmt.Println(planTree)
fmt.Println("++++")
// Don't check planTree directly, because it contains execution time info which is not fixed after open/close time is included
require.True(t, strings.Contains(planTree, ` Projection_3 root 10000 vec_cosine_distance(test.t.c, cast([100,100,100,100,100,100,100,100,100,100,100,100,100,100,100,100...(len:401), vector))->Column#4`))
require.True(t, strings.Contains(planTree, ` └─TableReader_6 root 10000 data:TableFullScan_5`))
require.True(t, strings.Contains(planTree, ` └─TableFullScan_5 cop[tikv] 10000 table:t, keep order:false, stats:pseudo`))
// No need to check result at all.
tk.ResultSetToResult(rs, fmt.Sprintf("%v", rs))
tkProcess := tk.Session().ShowProcess()
ps := []*sessmgr.ProcessInfo{tkProcess}
tk.Session().SetSessionManager(&testkit.MockSessionManager{PS: ps})
tk.MustQuery("explain for connection " + strconv.FormatUint(tkProcess.ID, 10)).Check(testkit.Rows(
`Projection 10.00 0 root time:0s, open:0s, close:0s, loops:0 vec_cosine_distance(test.t.c, [1,2,3,4,5,(6 more)...])->Column#4 N/A N/A`,
`└─TopN 10.00 0 root time:0s, open:0s, close:0s, loops:0 Column#5, offset:0, count:10 N/A N/A`,
` └─TableReader 10.00 0 root time:0s, open:0s, close:0s, loops:0 data:TopN N/A N/A`,
` └─TopN 10.00 0 cop[tikv] Column#5, offset:0, count:10 N/A N/A`,
` └─Projection 10.00 0 cop[tikv] test.t.c, vec_cosine_distance(test.t.c, [1,2,3,4,5,(6 more)...])->Column#5 N/A N/A`,
` └─TableFullScan 10000.00 0 cop[tikv] table:t keep order:false, stats:pseudo N/A N/A`))
}

func TestVectorIndexExplain(t *testing.T) {
Expand Down
18 changes: 9 additions & 9 deletions pkg/infoschema/test/clustertablestest/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -883,9 +883,9 @@ func TestStmtSummaryTable(t *testing.T) {
"from information_schema.statements_summary " +
"where digest_text like 'select * from `t`%'"
tk.MustQuery(sql).Check(testkit.Rows("Select test test.t t:k 1 0 0 0 0 0 0 0 0 0 0 select * from t where a=2 \tid \ttask \testRows\toperator info\n" +
"\tIndexLookUp_8 \troot \t100 \t\n" +
"\t├─IndexRangeScan_6(Build)\tcop[tikv]\t100 \ttable:t, index:k(a), range:[2,2], keep order:false, stats:pseudo\n" +
"\t└─TableRowIDScan_7(Probe)\tcop[tikv]\t100 \ttable:t, keep order:false, stats:pseudo"))
"\tIndexLookUp_7 \troot \t100 \t\n" +
"\t├─IndexRangeScan_5(Build)\tcop[tikv]\t100 \ttable:t, index:k(a), range:[2,2], keep order:false, stats:pseudo\n" +
"\t└─TableRowIDScan_6(Probe)\tcop[tikv]\t100 \ttable:t, keep order:false, stats:pseudo"))

// select ... order by
tk.MustQuery(`select stmt_type, schema_name, table_names, index_names, exec_count, sum_cop_task_num, avg_total_keys,
Expand All @@ -905,9 +905,9 @@ func TestStmtSummaryTable(t *testing.T) {
"where digest_text like 'select * from `t`%'"
tk.MustQuery(sql).Check(testkit.Rows(
"Select test test.t t:k 2 0 0 0 0 0 0 0 0 0 0 select * from t where a=2 \tid \ttask \testRows\toperator info\n" +
"\tIndexLookUp_8 \troot \t100 \t\n" +
"\t├─IndexRangeScan_6(Build)\tcop[tikv]\t100 \ttable:t, index:k(a), range:[2,2], keep order:false, stats:pseudo\n" +
"\t└─TableRowIDScan_7(Probe)\tcop[tikv]\t100 \ttable:t, keep order:false, stats:pseudo"))
"\tIndexLookUp_7 \troot \t100 \t\n" +
"\t├─IndexRangeScan_5(Build)\tcop[tikv]\t100 \ttable:t, index:k(a), range:[2,2], keep order:false, stats:pseudo\n" +
"\t└─TableRowIDScan_6(Probe)\tcop[tikv]\t100 \ttable:t, keep order:false, stats:pseudo"))

// Disable it again.
tk.MustExec("set global tidb_enable_stmt_summary = false")
Expand Down Expand Up @@ -953,9 +953,9 @@ func TestStmtSummaryTable(t *testing.T) {
"from information_schema.statements_summary " +
"where digest_text like 'select * from `t`%'"
tk.MustQuery(sql).Check(testkit.Rows("Select test test.t t:k 1 0 0 0 0 0 0 0 0 0 0 select * from t where a=2 \tid \ttask \testRows\toperator info\n" +
"\tIndexLookUp_8 \troot \t1000 \t\n" +
"\t├─IndexRangeScan_6(Build)\tcop[tikv]\t1000 \ttable:t, index:k(a), range:[2,2], keep order:false, stats:pseudo\n" +
"\t└─TableRowIDScan_7(Probe)\tcop[tikv]\t1000 \ttable:t, keep order:false, stats:pseudo"))
"\tIndexLookUp_7 \troot \t1000 \t\n" +
"\t├─IndexRangeScan_5(Build)\tcop[tikv]\t1000 \ttable:t, index:k(a), range:[2,2], keep order:false, stats:pseudo\n" +
"\t└─TableRowIDScan_6(Probe)\tcop[tikv]\t1000 \ttable:t, keep order:false, stats:pseudo"))

// Disable it in global scope.
tk.MustExec("set global tidb_enable_stmt_summary = false")
Expand Down
24 changes: 21 additions & 3 deletions pkg/planner/cardinality/selectivity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,9 @@ func TestIndexEstimationCrossValidate(t *testing.T) {
tk.MustQuery("explain format = 'brief' select * from t where a = 1 and b = 2").Check(testkit.Rows(
"IndexReader 1.00 root index:IndexRangeScan",
"└─IndexRangeScan 1.00 cop[tikv] table:t, index:a(a, b) range:[1 2,1 2], keep order:false"))
tk.MustQuery("explain select * from t where a = 1 and b = 2").Check(testkit.Rows(
"IndexReader_6 1.00 root index:IndexRangeScan_5",
"└─IndexRangeScan_5 1.00 cop[tikv] table:t, index:a(a, b) range:[1 2,1 2], keep order:false"))
require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/pkg/statistics/table/mockQueryBytesMaxUint64"))

// Test issue 22466
Expand Down Expand Up @@ -1773,6 +1776,11 @@ func TestIgnoreRealtimeStats(t *testing.T) {
"└─Selection 1.00 cop[tikv] eq(test.t.a, 1), gt(test.t.b, 2)",
" └─TableFullScan 11.00 cop[tikv] table:t keep order:false, stats:pseudo",
))
testKit.MustQuery("explain select * from t where a = 1 and b > 2").Check(testkit.Rows(
"TableReader_7 1.00 root data:Selection_6",
"└─Selection_6 1.00 cop[tikv] eq(test.t.a, 1), gt(test.t.b, 2)",
" └─TableFullScan_5 11.00 cop[tikv] table:t keep order:false, stats:pseudo",
))

// 1-2. ignore real-time stats.
// Use pseudo stats table. The total row count is 10000.
Expand All @@ -1782,6 +1790,11 @@ func TestIgnoreRealtimeStats(t *testing.T) {
"└─Selection 3.33 cop[tikv] eq(test.t.a, 1), gt(test.t.b, 2)",
" └─TableFullScan 10000.00 cop[tikv] table:t keep order:false, stats:pseudo",
))
testKit.MustQuery("explain select * from t where a = 1 and b > 2").Check(testkit.Rows(
"TableReader_7 3.33 root data:Selection_6",
"└─Selection_6 3.33 cop[tikv] eq(test.t.a, 1), gt(test.t.b, 2)",
" └─TableFullScan_5 10000.00 cop[tikv] table:t keep order:false, stats:pseudo",
))

// 2. After ANALYZE.
testKit.MustExec("analyze table t all columns with 1 samplerate")
Expand Down Expand Up @@ -1810,8 +1823,7 @@ func TestIgnoreRealtimeStats(t *testing.T) {
testKit.MustQuery("explain format = 'brief' select * from t where a = 1 and b > 2").Check(testkit.Rows(
"TableReader 3.72 root data:Selection",
"└─Selection 3.72 cop[tikv] eq(test.t.a, 1), gt(test.t.b, 2)",
" └─TableFullScan 15.00 cop[tikv] table:t keep order:false",
))
" └─TableFullScan 15.00 cop[tikv] table:t keep order:false"))

// 3-2. ignore real-time stats.
// The execution plan is the same as case 2.
Expand Down Expand Up @@ -2206,13 +2218,19 @@ func TestIssue64137(t *testing.T) {
statsMeta := tk.MustQuery(`show stats_meta`).Rows()[0]
require.Equal(t, statsMeta[4], "2000") // modify_count = 2000
require.Equal(t, statsMeta[5], "12000") // row_count = 10000+2000

tk.MustQuery(`explain format = 'brief' select * from t where a=99999999`).Check(testkit.Rows(
`IndexReader 24.00 root index:IndexRangeScan`, // out-of-range est for small NDV, result should close to zero
`└─IndexRangeScan 24.00 cop[tikv] table:t, index:a(a) range:[99999999,99999999], keep order:false`))
tk.MustQuery(`explain format = 'brief' select * from t where a=1`).Check(testkit.Rows(
`IndexReader 12000.00 root index:IndexRangeScan`, // in-range est for small NDV
`└─IndexRangeScan 12000.00 cop[tikv] table:t, index:a(a) range:[1,1], keep order:false`))

tk.MustQuery(`explain select * from t where a=99999999`).Check(testkit.Rows(
`IndexReader_6 24.00 root index:IndexRangeScan_5`, // out-of-range est for small NDV, result should close to zero
`└─IndexRangeScan_5 24.00 cop[tikv] table:t, index:a(a) range:[99999999,99999999], keep order:false`))
tk.MustQuery(`explain select * from t where a=1`).Check(testkit.Rows(
`IndexReader_6 12000.00 root index:IndexRangeScan_5`, // in-range est for small NDV
`└─IndexRangeScan_5 12000.00 cop[tikv] table:t, index:a(a) range:[1,1], keep order:false`))
}

func TestUninitializedStats(t *testing.T) {
Expand Down
48 changes: 24 additions & 24 deletions pkg/planner/cardinality/testdata/cardinality_suite_out.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,48 +274,48 @@
"Name": "TestColumnIndexNullEstimation",
"Cases": [
[
"IndexReader 4.00 root index:IndexRangeScan",
"└─IndexRangeScan 4.00 cop[tikv] table:t, index:idx_b(b) range:[NULL,NULL], keep order:false"
"IndexReader_6 4.00 root index:IndexRangeScan_5",
"└─IndexRangeScan_5 4.00 cop[tikv] table:t, index:idx_b(b) range:[NULL,NULL], keep order:false"
],
[
"IndexReader 1.00 root index:IndexFullScan",
"└─IndexFullScan 1.00 cop[tikv] table:t, index:idx_b(b) keep order:false"
"IndexReader_6 1.00 root index:IndexFullScan_5",
"└─IndexFullScan_5 1.00 cop[tikv] table:t, index:idx_b(b) keep order:false"
],
[
"IndexReader 4.00 root index:IndexRangeScan",
"└─IndexRangeScan 4.00 cop[tikv] table:t, index:idx_b(b) range:[NULL,NULL], (3,+inf], keep order:false"
"IndexReader_6 4.00 root index:IndexRangeScan_5",
"└─IndexRangeScan_5 4.00 cop[tikv] table:t, index:idx_b(b) range:[NULL,NULL], (3,+inf], keep order:false"
],
[
"IndexReader 5.00 root index:IndexFullScan",
"└─IndexFullScan 5.00 cop[tikv] table:t, index:idx_b(b) keep order:false"
"IndexReader_5 5.00 root index:IndexFullScan_4",
"└─IndexFullScan_4 5.00 cop[tikv] table:t, index:idx_b(b) keep order:false"
],
[
"IndexReader 1.00 root index:IndexRangeScan",
"└─IndexRangeScan 1.00 cop[tikv] table:t, index:idx_b(b) range:[-inf,4), keep order:false"
"IndexReader_6 1.00 root index:IndexRangeScan_5",
"└─IndexRangeScan_5 1.00 cop[tikv] table:t, index:idx_b(b) range:[-inf,4), keep order:false"
],
[
"TableReader 1.00 root data:Selection",
"└─Selection 1.00 cop[tikv] isnull(test.t.a)",
" └─TableFullScan 5.00 cop[tikv] table:t keep order:false"
"TableReader_7 1.00 root data:Selection_6",
"└─Selection_6 1.00 cop[tikv] isnull(test.t.a)",
" └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
],
[
"TableReader 4.00 root data:Selection",
"└─Selection 4.00 cop[tikv] not(isnull(test.t.a))",
" └─TableFullScan 5.00 cop[tikv] table:t keep order:false"
"TableReader_7 4.00 root data:Selection_6",
"└─Selection_6 4.00 cop[tikv] not(isnull(test.t.a))",
" └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
],
[
"TableReader 2.00 root data:Selection",
"└─Selection 2.00 cop[tikv] or(isnull(test.t.a), gt(test.t.a, 3))",
" └─TableFullScan 5.00 cop[tikv] table:t keep order:false"
"TableReader_7 2.00 root data:Selection_6",
"└─Selection_6 2.00 cop[tikv] or(isnull(test.t.a), gt(test.t.a, 3))",
" └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
],
[
"TableReader 5.00 root data:TableFullScan",
"└─TableFullScan 5.00 cop[tikv] table:t keep order:false"
"TableReader_5 5.00 root data:TableFullScan_4",
"└─TableFullScan_4 5.00 cop[tikv] table:t keep order:false"
],
[
"TableReader 3.00 root data:Selection",
"└─Selection 3.00 cop[tikv] lt(test.t.a, 4)",
" └─TableFullScan 5.00 cop[tikv] table:t keep order:false"
"TableReader_7 3.00 root data:Selection_6",
"└─Selection_6 3.00 cop[tikv] lt(test.t.a, 4)",
" └─TableFullScan_5 5.00 cop[tikv] table:t keep order:false"
]
]
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/planner/cascades/cascades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestCascadesDrive(t *testing.T) {
tk.MustQuery("select 1").Check(testkit.Rows("1"))
tk.MustQuery("explain select 1").Check(testkit.Rows(""+
"Projection_3 1.00 root 1->Column#1",
"└─TableDual_5 1.00 root rows:1"))
"└─TableDual_4 1.00 root rows:1"))
}

func TestXFormedOperatorShouldDeriveTheirStatsOwn(t *testing.T) {
Expand Down
15 changes: 12 additions & 3 deletions pkg/planner/cascades/memo/group_expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,19 +223,23 @@ func (e *GroupExpression) DeriveLogicalProp() (err error) {
}
childStats := make([]*property.StatsInfo, 0, len(e.Inputs))
childSchema := make([]*expression.Schema, 0, len(e.Inputs))
childProperties := make([][][]*expression.Column, 0, len(e.Inputs))
childProperties := make([]*base.PossiblePropertiesInfo, 0, len(e.Inputs))
for _, childG := range e.Inputs {
childGProp := childG.GetLogicalProperty()
childStats = append(childStats, childGProp.Stats)
childSchema = append(childSchema, childGProp.Schema)
childProperties = append(childProperties, childGProp.PossibleProps)
childProperties = append(childProperties, &base.PossiblePropertiesInfo{
Order: childGProp.PossibleProps,
HasTiflash: childGProp.HasTiflash,
})
}
e.GetGroup().SetLogicalProperty(property.NewLogicalProp())
// currently the schemaProducer side logical op is still useful for group schema.
tmpFD := e.LogicalPlan.GetBaseLogicalPlan().(*logicalop.BaseLogicalPlan).FDs()
tmpSchema := e.LogicalPlan.Schema()
tmpStats := e.LogicalPlan.StatsInfo()
var tmpPossibleProps [][]*expression.Column
var tmpHasTiflash bool
// the leaves node may have already had their stats in join reorder est phase, while
// their group ndv signal is passed in CollectPredicateColumnsPoint which is applied
// behind join reorder rule, we should build their group ndv again (implied in DeriveStats).
Expand All @@ -252,12 +256,17 @@ func (e *GroupExpression) DeriveLogicalProp() (err error) {
// todo: extractFD should be refactored as take in childFDs, and return the new FDSet rather than depend on tree.
tmpFD = e.LogicalPlan.ExtractFD()
// prepare the possible sort columns for the group, which require fillIndexPath to fill index cols.
tmpPossibleProps = e.LogicalPlan.PreparePossibleProperties(tmpSchema, childProperties...)
tmp := e.LogicalPlan.PreparePossibleProperties(tmpSchema, childProperties...)
if tmp != nil {
tmpPossibleProps = tmp.Order
tmpHasTiflash = tmp.HasTiflash
}
}
e.GetGroup().GetLogicalProperty().Schema = tmpSchema
e.GetGroup().GetLogicalProperty().Stats = tmpStats
e.GetGroup().GetLogicalProperty().FD = tmpFD
e.GetGroup().GetLogicalProperty().PossibleProps = tmpPossibleProps
e.GetGroup().GetLogicalProperty().HasTiflash = tmpHasTiflash
return nil
}

Expand Down
Loading