-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Optimization of table metadata initialization #1951
Comments
i meet the same issue
|
@tristaZero @terrymanu. Does this issue still need a volunteer? |
can lazyload sharding table meta data?not load all table meta data on start |
@wgy8283335 did you have fixed this issue already? |
@tristaZero Hello, I am using shardingsphere3.1.0. In #1944, it has solved the problem of not loading the schema when loading all the tables, but it also does not consider the schema when loading all the columns of the table in private List<ColumnMetaData> getColumnMetaDataList(final Connection connection, final String catalog, final String actualTableName) throws SQLException {
List<ColumnMetaData> result = new LinkedList<>();
Collection<String> primaryKeys = getPrimaryKeys(connection, catalog, actualTableName);
try (ResultSet resultSet = connection.getMetaData().getColumns(catalog, null, actualTableName, null)) {
while (resultSet.next()) {
String columnName = resultSet.getString("COLUMN_NAME");
String columnType = resultSet.getString("TYPE_NAME");
result.add(new ColumnMetaData(columnName, columnType, primaryKeys.contains(columnName)));
}
}
return result;
} Is it possible to add |
you may have a try |
@terrymanu Yes, I tried. And the system startup speed is getting faster. Now, in our project, we skip some code about init table metadata. I have not found any effect on the system running. |
To make start up of ShardingSphere faster, we will do the following improvements:
This issue is related with #1933.
The text was updated successfully, but these errors were encountered: