k1LoW / tbls

tbls is a CI-Friendly tool for document a database, written in Go.
MIT License
3.37k stars 165 forks source link

Bulk get schema info for MySQL #428

Closed yasu89 closed 1 year ago

yasu89 commented 1 year ago

About

In databases with a large number of tables, it took a long time to execute the process, so I improved it.

Description

The queries to retrieve schema information were issued for each table, resulting in a large overhead and time consuming query processing.

Therefore, we reduced the number of queries by retrieving schema information in batches whenever possible.

FYI

Result of time in my environment. (over 1,000 tables)

before: about 90min after: about 3min

k1LoW commented 1 year ago

@yasu89 GREAT!!!!!!

yasu89 commented 1 year ago

@k1LoW Sorry for the test failure 🙇‍♂️

The cause was that the order of the relations variable had changed before and after the modification, so I sorted it so that it is the same as before the modification.

k1LoW commented 1 year ago

@yasu89 Thank you!!!