Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

planner,executor,infoschema: add system tables tiflash_tables and tiflash_segments #18092

Merged
merged 33 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8ce4fff
Almost complete
lidezhu Jun 16, 2020
5be7b87
Refactor code
lidezhu Jun 17, 2020
4eec403
Add test
lidezhu Jun 17, 2020
b6bebfa
format code
lidezhu Jun 17, 2020
a4d0305
small fix
lidezhu Jun 17, 2020
7811f47
small fix
lidezhu Jun 17, 2020
7d17cb8
comment test
lidezhu Jun 17, 2020
00ec1cc
restore test
lidezhu Jun 17, 2020
9a57385
Merge branch 'master' into add-dt-system-table
lidezhu Jun 17, 2020
f6194b5
rename tiflash_node to tiflash_instance
lidezhu Jun 18, 2020
2bc98d0
small fix
lidezhu Jun 18, 2020
c521e60
small fix
lidezhu Jun 18, 2020
aac7c0f
small fix
lidezhu Jun 18, 2020
82ba328
small fix
lidezhu Jun 18, 2020
66609bd
Merge branch 'master' into add-dt-system-table
lidezhu Jun 18, 2020
7dae1a4
format code
lidezhu Jun 18, 2020
1b499c4
small fix
lidezhu Jun 18, 2020
e509c3c
Merge branch 'master' into add-dt-system-table
crazycs520 Jun 18, 2020
c89572e
send tidb_database and tidb_table filter to tiflash
lidezhu Jun 18, 2020
c0024c9
fix typo
lidezhu Jun 18, 2020
958830d
try add more test
lidezhu Jun 18, 2020
8ed1168
modify test again
lidezhu Jun 18, 2020
f360e5f
small fix
lidezhu Jun 18, 2020
36c12ca
add two new columns
lidezhu Jun 19, 2020
8504956
Merge branch 'master' into add-dt-system-table
crazycs520 Jun 19, 2020
6ebc983
Merge branch 'master' into add-dt-system-table
crazycs520 Jun 28, 2020
15ac356
Fix comment
lidezhu Jun 29, 2020
74943a0
Fix test
lidezhu Jun 29, 2020
a53bd37
Merge branch 'master' into add-dt-system-table
lidezhu Jun 29, 2020
4858d97
Merge branch 'master' into add-dt-system-table
lidezhu Jul 3, 2020
237c6f3
Merge branch 'master' into add-dt-system-table
crazycs520 Jul 3, 2020
16884ec
Merge branch 'master' into add-dt-system-table
lidezhu Jul 3, 2020
ed5b2ae
Merge branch 'master' into add-dt-system-table
crazycs520 Jul 7, 2020
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
11 changes: 11 additions & 0 deletions executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1489,6 +1489,17 @@ func (b *executorBuilder) buildMemTable(v *plannercore.PhysicalMemTable) Executo
baseExecutor: newBaseExecutor(b.ctx, v.Schema(), v.ExplainID()),
is: b.is,
}
case strings.ToLower(infoschema.TableTiFlashTables),
strings.ToLower(infoschema.TableTiFlashSegments):
return &MemTableReaderExec{
baseExecutor: newBaseExecutor(b.ctx, v.Schema(), v.ExplainID()),
table: v.Table,
retriever: &TiFlashSystemTableRetriever{
table: v.Table,
outputCols: v.Columns,
extractor: v.Extractor.(*plannercore.TiFlashSystemTableExtractor),
},
}
}
}
tb, _ := b.is.TableByID(v.Table.ID)
Expand Down
23 changes: 23 additions & 0 deletions executor/explainfor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,26 @@ func (s *testSuite) TestInspectionSummaryTable(c *C) {
`└─MemTableScan_6 10000.00 root table:INSPECTION_SUMMARY skip_inspection: true`,
))
}

func (s *testSuite) TestExplainTiFlashSystemTables(c *C) {
tk := testkit.NewTestKitWithInit(c, s.store)
tiflashInstance := "192.168.1.7:3930"
database := "test"
table := "t"
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_TABLES where TIFLASH_INSTANCE = '%s'", tiflashInstance)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_TABLES tiflash_instances:[\"%s\"]", tiflashInstance)))
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_SEGMENTS where TIFLASH_INSTANCE = '%s'", tiflashInstance)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_SEGMENTS tiflash_instances:[\"%s\"]", tiflashInstance)))
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_TABLES where TIDB_DATABASE = '%s'", database)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_TABLES tidb_databases:[\"%s\"]", database)))
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_SEGMENTS where TIDB_DATABASE = '%s'", database)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_SEGMENTS tidb_databases:[\"%s\"]", database)))
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_TABLES where TIDB_TABLE = '%s'", table)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_TABLES tidb_tables:[\"%s\"]", table)))
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_SEGMENTS where TIDB_TABLE = '%s'", table)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_SEGMENTS tidb_tables:[\"%s\"]", table)))
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_TABLES where TIFLASH_INSTANCE = '%s' and TIDB_DATABASE = '%s' and TIDB_TABLE = '%s'", tiflashInstance, database, table)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_TABLES tiflash_instances:[\"%s\"], tidb_databases:[\"%s\"], tidb_tables:[\"%s\"]", tiflashInstance, database, table)))
tk.MustQuery(fmt.Sprintf("desc select * from information_schema.TIFLASH_SEGMENTS where TIFLASH_INSTANCE = '%s' and TIDB_DATABASE = '%s' and TIDB_TABLE = '%s'", tiflashInstance, database, table)).Check(testkit.Rows(
fmt.Sprintf("MemTableScan_5 10000.00 root table:TIFLASH_SEGMENTS tiflash_instances:[\"%s\"], tidb_databases:[\"%s\"], tidb_tables:[\"%s\"]", tiflashInstance, database, table)))
}
181 changes: 181 additions & 0 deletions executor/infoschema_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"sort"
"strconv"
"strings"
"sync"
"time"
Expand All @@ -27,6 +30,8 @@ import (
"github.com/pingcap/parser/charset"
"github.com/pingcap/parser/model"
"github.com/pingcap/parser/mysql"
"github.com/pingcap/parser/terror"
"github.com/pingcap/tidb/domain"
"github.com/pingcap/tidb/domain/infosync"
"github.com/pingcap/tidb/infoschema"
"github.com/pingcap/tidb/meta/autoid"
Expand All @@ -47,6 +52,7 @@ import (
"github.com/pingcap/tidb/util/set"
"github.com/pingcap/tidb/util/sqlexec"
"github.com/pingcap/tidb/util/stmtsummary"
"go.etcd.io/etcd/clientv3"
)

type memtableRetriever struct {
Expand Down Expand Up @@ -1760,3 +1766,178 @@ func (e *memtableRetriever) setDataForStatementsSummary(ctx sessionctx.Context,
}
return nil
}

// TiFlashSystemTableRetriever is used to read system table from tiflash.
type TiFlashSystemTableRetriever struct {
dummyCloser
table *model.TableInfo
outputCols []*model.ColumnInfo
instanceCount int
instanceIdx int
instanceInfos []tiflashInstanceInfo
rowIdx int
retrieved bool
initialized bool
extractor *plannercore.TiFlashSystemTableExtractor
}

func (e *TiFlashSystemTableRetriever) retrieve(ctx context.Context, sctx sessionctx.Context) ([][]types.Datum, error) {
if e.extractor.SkipRequest || e.retrieved {
return nil, nil
}
if !e.initialized {
err := e.initialize(sctx, e.extractor.TiFlashInstances)
if err != nil {
return nil, err
}
}
if e.instanceCount == 0 || e.instanceIdx >= e.instanceCount {
e.retrieved = true
return nil, nil
}

for {
rows, err := e.dataForTiFlashSystemTables(sctx, e.extractor.TiDBDatabases, e.extractor.TiDBTables)
if err != nil {
return nil, err
}
if len(rows) > 0 || e.instanceIdx >= e.instanceCount {
return rows, nil
}
}
}

type tiflashInstanceInfo struct {
id string
url string
}

func (e *TiFlashSystemTableRetriever) initialize(sctx sessionctx.Context, tiflashInstances set.StringSet) error {
store := sctx.GetStore()
if etcd, ok := store.(tikv.EtcdBackend); ok {
if addrs := etcd.EtcdAddrs(); addrs != nil {
lidezhu marked this conversation as resolved.
Show resolved Hide resolved
domainFromCtx := domain.GetDomain(sctx)
if domainFromCtx != nil {
cli := domainFromCtx.GetEtcdClient()
prefix := "/tiflash/cluster/http_port/"
kv := clientv3.NewKV(cli)
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
resp, err := kv.Get(ctx, prefix, clientv3.WithPrefix())
cancel()
if err != nil {
return errors.Trace(err)
}
for _, ev := range resp.Kvs {
id := string(ev.Key)[len(prefix):]
if len(tiflashInstances) > 0 && !tiflashInstances.Exist(id) {
continue
}
// TODO: Support https in tiflash
url := fmt.Sprintf("http://%s", ev.Value)
e.instanceInfos = append(e.instanceInfos, tiflashInstanceInfo{
id: id,
url: url,
})
e.instanceCount += 1
}
e.initialized = true
return nil
}
return errors.Errorf("Etcd client not found")
}
return errors.Errorf("Etcd addrs not found")
}
return errors.Errorf("%T not an etcd backend", store)
}

func (e *TiFlashSystemTableRetriever) dataForTiFlashSystemTables(ctx sessionctx.Context, tidbDatabases string, tidbTables string) ([][]types.Datum, error) {
var columnNames []string
for _, c := range e.outputCols {
if c.Name.O == "TIFLASH_INSTANCE" {
continue
}
columnNames = append(columnNames, c.Name.L)
}
maxCount := 1024
targetTable := strings.ToLower(strings.Replace(e.table.Name.O, "TIFLASH", "DT", 1))
var filters []string
if len(tidbDatabases) > 0 {
filters = append(filters, fmt.Sprintf("tidb_database IN (%s)", strings.ReplaceAll(tidbDatabases, "\"", "'")))
}
if len(tidbTables) > 0 {
filters = append(filters, fmt.Sprintf("tidb_table IN (%s)", strings.ReplaceAll(tidbTables, "\"", "'")))
}
sql := fmt.Sprintf("SELECT %s FROM system.%s", strings.Join(columnNames, ","), targetTable)
if len(filters) > 0 {
sql = fmt.Sprintf("%s WHERE %s", sql, strings.Join(filters, " AND "))
}
sql = fmt.Sprintf("%s LIMIT %d, %d", sql, e.rowIdx, maxCount)
notNumber := "nan"
httpClient := http.DefaultClient
instanceInfo := e.instanceInfos[e.instanceIdx]
url := instanceInfo.url
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, errors.Trace(err)
}
q := req.URL.Query()
q.Add("query", sql)
req.URL.RawQuery = q.Encode()
resp, err := httpClient.Do(req)
if err != nil {
return nil, errors.Trace(err)
}
body, err := ioutil.ReadAll(resp.Body)
terror.Log(resp.Body.Close())
if err != nil {
return nil, errors.Trace(err)
}
records := strings.Split(string(body), "\n")
var rows [][]types.Datum
for _, record := range records {
if len(record) == 0 {
continue
}
fields := strings.Split(record, "\t")
if len(fields) < len(e.outputCols)-1 {
return nil, errors.Errorf("Record from tiflash doesn't match schema %v", fields)
}
row := make([]types.Datum, len(e.outputCols))
for index, column := range e.outputCols {
if column.Name.O == "TIFLASH_INSTANCE" {
continue
}
if column.Tp == mysql.TypeVarchar {
row[index].SetString(fields[index], mysql.DefaultCollationName)
} else if column.Tp == mysql.TypeLonglong {
if fields[index] == notNumber {
continue
}
value, err := strconv.ParseInt(fields[index], 10, 64)
if err != nil {
return nil, errors.Trace(err)
}
row[index].SetInt64(value)
} else if column.Tp == mysql.TypeDouble {
if fields[index] == notNumber {
continue
}
value, err := strconv.ParseFloat(fields[index], 64)
if err != nil {
return nil, errors.Trace(err)
}
row[index].SetFloat64(value)
} else {
return nil, errors.Errorf("Meet column of unknown type %v", column)
}
}
row[len(e.outputCols)-1].SetString(instanceInfo.id, mysql.DefaultCollationName)
rows = append(rows, row)
}
e.rowIdx += len(rows)
if len(rows) < maxCount {
e.instanceIdx += 1
e.rowIdx = 0
}
return rows, nil
}
8 changes: 8 additions & 0 deletions executor/infoschema_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,3 +812,11 @@ func (s *testInfoschemaTableSuite) TestSequences(c *C) {
tk.MustExec("CREATE SEQUENCE test.seq2 start = -9 minvalue -10 maxvalue 10 increment -1 cache 15")
tk.MustQuery("SELECT * FROM information_schema.sequences WHERE sequence_schema='test' AND sequence_name='seq2'").Check(testkit.Rows("def test seq2 1 15 0 -1 10 -10 -9 "))
}

func (s *testInfoschemaTableSuite) TestTiFlashSystemTables(c *C) {
tk := testkit.NewTestKit(c, s.store)
err := tk.QueryToErr("select * from information_schema.TIFLASH_TABLES;")
c.Assert(err.Error(), Equals, "Etcd addrs not found")
err = tk.QueryToErr("select * from information_schema.TIFLASH_SEGMENTS;")
c.Assert(err.Error(), Equals, "Etcd addrs not found")
}
87 changes: 87 additions & 0 deletions infoschema/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ const (
TableStatementsSummaryHistory = "STATEMENTS_SUMMARY_HISTORY"
// TableStorageStats is a table that contains all tables disk usage
TableStorageStats = "TABLE_STORAGE_STATS"
// TableTiFlashTables is the string constant of tiflash tables table.
TableTiFlashTables = "TIFLASH_TABLES"
// TableTiFlashSegments is the string constant of tiflash segments table.
TableTiFlashSegments = "TIFLASH_SEGMENTS"
)

var tableIDMap = map[string]int64{
Expand Down Expand Up @@ -213,6 +217,8 @@ var tableIDMap = map[string]int64{
ClusterTableStatementsSummary: autoid.InformationSchemaDBID + 61,
ClusterTableStatementsSummaryHistory: autoid.InformationSchemaDBID + 62,
TableStorageStats: autoid.InformationSchemaDBID + 63,
TableTiFlashTables: autoid.InformationSchemaDBID + 64,
TableTiFlashSegments: autoid.InformationSchemaDBID + 65,
}

type columnInfo struct {
Expand Down Expand Up @@ -1128,6 +1134,85 @@ var tableStorageStatsCols = []columnInfo{
{name: "TABLE_KEYS", tp: mysql.TypeLonglong, size: 64, comment: "The count of keys of single replica of the table"},
}

var tableTableTiFlashTablesCols = []columnInfo{
{name: "DATABASE", tp: mysql.TypeVarchar, size: 64},
{name: "TABLE", tp: mysql.TypeVarchar, size: 64},
{name: "TIDB_DATABASE", tp: mysql.TypeVarchar, size: 64},
{name: "TIDB_TABLE", tp: mysql.TypeVarchar, size: 64},
{name: "TABLE_ID", tp: mysql.TypeLonglong, size: 64},
{name: "IS_TOMBSTONE", tp: mysql.TypeLonglong, size: 64},
{name: "SEGMENT_COUNT", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_ROWS", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_DELETE_RANGES", tp: mysql.TypeLonglong, size: 64},
{name: "DELTA_RATE_ROWS", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_RATE_SEGMENTS", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_PLACED_RATE", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_CACHE_SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "DELTA_CACHE_RATE", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_CACHE_WASTED_RATE", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_INDEX_SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "AVG_SEGMENT_ROWS", tp: mysql.TypeDouble, size: 64},
{name: "AVG_SEGMENT_SIZE", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_COUNT", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_DELTA_ROWS", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_DELTA_SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "AVG_DELTA_ROWS", tp: mysql.TypeDouble, size: 64},
{name: "AVG_DELTA_SIZE", tp: mysql.TypeDouble, size: 64},
{name: "AVG_DELTA_DELETE_RANGES", tp: mysql.TypeDouble, size: 64},
{name: "STABLE_COUNT", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_STABLE_ROWS", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_STABLE_SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "TOTAL_STABLE_SIZE_ON_DISK", tp: mysql.TypeLonglong, size: 64},
{name: "AVG_STABLE_ROWS", tp: mysql.TypeDouble, size: 64},
{name: "AVG_STABLE_SIZE", tp: mysql.TypeDouble, size: 64},
{name: "TOTAL_PACK_COUNT_IN_DELTA", tp: mysql.TypeLonglong, size: 64},
{name: "AVG_PACK_COUNT_IN_DELTA", tp: mysql.TypeDouble, size: 64},
{name: "AVG_PACK_ROWS_IN_DELTA", tp: mysql.TypeDouble, size: 64},
{name: "AVG_PACK_SIZE_IN_DELTA", tp: mysql.TypeDouble, size: 64},
{name: "TOTAL_PACK_COUNT_IN_STABLE", tp: mysql.TypeLonglong, size: 64},
{name: "AVG_PACK_COUNT_IN_STABLE", tp: mysql.TypeDouble, size: 64},
{name: "AVG_PACK_ROWS_IN_STABLE", tp: mysql.TypeDouble, size: 64},
{name: "AVG_PACK_SIZE_IN_STABLE", tp: mysql.TypeDouble, size: 64},
{name: "STORAGE_STABLE_NUM_SNAPSHOTS", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_STABLE_NUM_PAGES", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_STABLE_NUM_NORMAL_PAGES", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_STABLE_MAX_PAGE_ID", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_DELTA_NUM_SNAPSHOTS", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_DELTA_NUM_PAGES", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_DELTA_NUM_NORMAL_PAGES", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_DELTA_MAX_PAGE_ID", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_META_NUM_SNAPSHOTS", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_META_NUM_PAGES", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_META_NUM_NORMAL_PAGES", tp: mysql.TypeLonglong, size: 64},
{name: "STORAGE_META_MAX_PAGE_ID", tp: mysql.TypeLonglong, size: 64},
{name: "BACKGROUND_TASKS_LENGTH", tp: mysql.TypeLonglong, size: 64},
{name: "TIFLASH_INSTANCE", tp: mysql.TypeVarchar, size: 64},
}

var tableTableTiFlashSegmentsCols = []columnInfo{
{name: "DATABASE", tp: mysql.TypeVarchar, size: 64},
{name: "TABLE", tp: mysql.TypeVarchar, size: 64},
{name: "TIDB_DATABASE", tp: mysql.TypeVarchar, size: 64},
{name: "TIDB_TABLE", tp: mysql.TypeVarchar, size: 64},
{name: "TABLE_ID", tp: mysql.TypeLonglong, size: 64},
{name: "IS_TOMBSTONE", tp: mysql.TypeLonglong, size: 64},
{name: "SEGMENT_ID", tp: mysql.TypeLonglong, size: 64},
{name: "RANGE", tp: mysql.TypeVarchar, size: 64},
{name: "ROWS", tp: mysql.TypeLonglong, size: 64},
{name: "SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "DELETE_RANGES", tp: mysql.TypeLonglong, size: 64},
{name: "STABLE_SIZE_ON_DISK", tp: mysql.TypeLonglong, size: 64},
{name: "DELTA_PACK_COUNT", tp: mysql.TypeLonglong, size: 64},
{name: "STABLE_PACK_COUNT", tp: mysql.TypeLonglong, size: 64},
{name: "AVG_DELTA_PACK_ROWS", tp: mysql.TypeDouble, size: 64},
{name: "AVG_STABLE_PACK_ROWS", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_RATE", tp: mysql.TypeDouble, size: 64},
{name: "DELTA_CACHE_SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "DELTA_INDEX_SIZE", tp: mysql.TypeLonglong, size: 64},
{name: "TIFLASH_INSTANCE", tp: mysql.TypeVarchar, size: 64},
}

// GetShardingInfo returns a nil or description string for the sharding information of given TableInfo.
// The returned description string may be:
// - "NOT_SHARDED": for tables that SHARD_ROW_ID_BITS is not specified.
Expand Down Expand Up @@ -1431,6 +1516,8 @@ var tableNameToColumns = map[string][]columnInfo{
TableStatementsSummary: tableStatementsSummaryCols,
TableStatementsSummaryHistory: tableStatementsSummaryCols,
TableStorageStats: tableStorageStatsCols,
TableTiFlashTables: tableTableTiFlashTablesCols,
TableTiFlashSegments: tableTableTiFlashSegmentsCols,
}

func createInfoSchemaTable(_ autoid.Allocators, meta *model.TableInfo) (table.Table, error) {
Expand Down
2 changes: 2 additions & 0 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3011,6 +3011,8 @@ func (b *PlanBuilder) buildMemTable(_ context.Context, dbName model.CIStr, table
p.Extractor = &SlowQueryExtractor{}
case infoschema.TableStorageStats:
p.Extractor = &TableStorageStatsExtractor{}
case infoschema.TableTiFlashTables, infoschema.TableTiFlashSegments:
p.Extractor = &TiFlashSystemTableExtractor{}
}
}
return p, nil
Expand Down
Loading