Skip to content

[MySQL] Change: faster retrieval of schema#1540

Merged
arikfr merged 1 commit intogetredash:masterfrom
yaningzhu:faster-get-mysql-schema
Jan 24, 2017
Merged

[MySQL] Change: faster retrieval of schema#1540
arikfr merged 1 commit intogetredash:masterfrom
yaningzhu:faster-get-mysql-schema

Conversation

@yaningzhu
Copy link
Copy Markdown
Contributor

Because information_schema.tables and information_schema.columns do not have indexes on them, when they get large, joining them becomes painful. We have a database with over 10k tables and more than 200k columns. The old query takes forever.

The new query do not look at information_schema.tables at all. This works if your information_schema.columns table is in good shape in terms of data integrity (and it should be).

Tested on MySQL 5.5, 5.6(Percona), 5.7(Percona). The schema has not changed since then.

Because `information_schema.tables` and `information_schema.columns` do not have indexes on them, when they get large, joining them becomes painful. We have a database with over 10k tables and more than 200k columns. The old query takes forever.

The new query do not look at `information_schema.tables` at all. This works if your `information_schema.columns` table is in good shape in terms of data integrity (and it should be).

Tested on MySQL 5.5, 5.6(Percona), 5.7(Percona). The schema has not changed since then.
@arikfr arikfr changed the title Faster retrieval of MySQL schema [MySQL] Change: faster retrieval of schema Jan 24, 2017
@arikfr arikfr merged commit 4e7adcf into getredash:master Jan 24, 2017
@arikfr
Copy link
Copy Markdown
Member

arikfr commented Jan 24, 2017

Merged. Thanks!

dairyo pushed a commit to KiiCorp/redash that referenced this pull request Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants