pingcap / pingcap/tidb

Optimization statements performance related to system meta data

Open
#50,305 2 comments 0 reactions 1 assignee Claimed by @Benjamin2037 View on GitHub
component/ddl type/feature-request
Dominant language
Go
Stars
40.5k
Forks
6.2k
PR merge metrics
PR metrics pending

Description

## Feature Request

**Is your feature request related to a problem? Please describe:**

This issue will optimize the query performance for metadata-related statements

Scenario1:
```
SELECT column_name
FROM information_schema.statistics
WHERE index_name = 'PRIMARY'
AND table_schema = database()
AND table_name = 'xx'
ORDER BY seq_in_index;
```
Scenario2:
```
SELECT table_comment
FROM information_schema.tables
WHERE table_schema = database() AND table_name = 'xxx'
```
Scenario3:
```
SELECT table_name
FROM information_schema.tables
WHERE table_schema = database() AND table_type = 'xxx'
```

**Describe the feature you'd like:**

Speed up the query for metadata to be executed more quickly.
1. Push down predicates to memTableReader.
2. Do column pruning when reading infoschema.tables.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.