-
Notifications
You must be signed in to change notification settings - Fork 123
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
Schema introspection (SHOW FULL COLUMNS ...) became very slow #961
Comments
Thank you for the report, @gregsh! We'll take a look as soon as we can. |
Can you provide a step-by-step example we can reproduce? What operating system are you using? I thought I reproduced it so I started investigating, but everything seemed to work in tests and when I manually wrote the query. Then I realised the trailing |
I'm introspecting gitbase schema using soon to be released version of DataGrip and Mysql Connector/J 8.0.15. Here's the part of log, the ending quote does not belong to the query.
|
Still cannot reproduce this. val connection = DriverManager.getConnection(
"jdbc:mysql://%s?serverTimezone=UTC".format("localhost:3306"),
"root",
""
)
val meta = connection.getMetaData
val rs = meta.getColumns("gitbase", "", "%", "%")
while (rs.next()) {
println(rs.getString(3), rs.getString(4), rs.getString(5))
} And it prints
In 413ms. Tried both with master version and v0.24.0-rc1 using a docker container. |
I have found that it depends on the size of a repository. On a small one (70MB .git) it is fast, but on a large one (9GB .git) it is extremely slow. |
I just tried with the linux kernel and pytorch and it still takes milliseconds. Introspection never touches the repositories, so it should not depend on them. Do you have indexes created in gitbase? Perhaps it's the indexes checksum when starting the server. |
In gitbase 0.20 schema introspection is fast and full.
MySQL Connector/J JDBC metadata call that gets all columns for all tables at once
metaData.getColumns("gitbase", "", "%", "%")
is converted to calls like the following for each table
SHOW FULL COLUMNS FROM `commit_trees` FROM `gitbase` LIKE '%'"
In 0.23 and 0.24-rc the above queries are very slow (several minutes) and even fail for some tables completely in 0.23 (0.24 seems to fix that).
The above prevents from using gitbase in DB tools like JetBrains DataGrip.
The text was updated successfully, but these errors were encountered: