tidb icon indicating copy to clipboard operation
tidb copied to clipboard

Optimization statements performance related to system meta data

Open Benjamin2037 opened this issue 1 year ago • 1 comments

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.

Benjamin2037 avatar Jan 11 '24 06:01 Benjamin2037

/close as completed

ywqzzy avatar Apr 01 '24 10:04 ywqzzy

Releted to issue: https://github.com/pingcap/tidb/issues/50959

jebter avatar Mar 27 '25 03:03 jebter