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

[MySQL] Change: faster retrieval of schema #1540

Merged
merged 1 commit into from
Jan 24, 2017

Conversation

yaningzhu
Copy link
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
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