Skip to content

[FLINK-37855-][cdc-connector-mysql] Reduce the time cost in MySqlSchemaUtils#listTables #4032

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zhyayun
Copy link

@zhyayun zhyayun commented May 30, 2025

https://issues.apache.org/jira/browse/FLINK-37855
MySqlSchemaUtils#listTables and TableDiscoveryUtils#listTables is called to get the table names of all tables that need to be processed, However, in scenarios involving many databases and tables, this method call will require querying the database many times, resulting in a long processing time.
The optimization idea is to use mysql's metadata information, a connection to get all the library table information.

@lvyanquan
Copy link
Contributor

I think the key point is reusing the connection, instead of changing the query sql.
So passing Connection to listTables() method will be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants