RaigorJiang opened a new issue, #35683:
URL: https://github.com/apache/shardingsphere/issues/35683
### Which version of ShardingSphere did you use?
5.5.3-SNAPSHOT c1c77b20dabab3d87813262c3139dcba6535787c
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
When building a SingleRule, only load the table names from the data source
included in the rule
For example, if ds_0 and ds_1 are registered in the logic database, but the
single table rule only has `- ds_0.t_single`, there is no need to obtain the
table names from ds_1
```yaml
databaseName: sharding_db
dataSources:
ds_0:
password: 123456
url:
jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
username: root
minPoolSize: 1
maxPoolSize: 10
ds_1:
password: 123456
url:
jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=Asia/Shanghai&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true
username: root
minPoolSize: 1
maxPoolSize: 10
rules:
- !SINGLE
tables:
- ds_0.t_single
```
### Actual behavior
In the `SingleTableDataNodeLoader#load` method, the table names are first
obtained from all data sources, and then compared with the tables in single
rule, leaving the required parts, which wastes some time in loading table names.
<img width="974" alt="Image"
src="https://github.com/user-attachments/assets/fb81dea2-9717-4e57-84e2-0138c5351665"
/>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
[email protected]
For queries about this service, please contact Infrastructure at:
[email protected]