tiandihai opened a new issue, #29225:
URL: https://github.com/apache/shardingsphere/issues/29225
5.4.0升级到5.4.1之后,CLASS_BASED 方式自定义类的tableStrategy(分表策略)失效了。
我的分库策略 ds_sharding 是通过SPI方式引入的,5.4.0和5.4.1都正常生效。
但是分表策略 tb_sharding 是通过 type=CLASS_BASED
自定义类的方式引入的,5.4.0正常生效,但是升级到5.4.1之后就失效了,后面我给改成和上面的分库策略一样也通过SPI方式引入,也不生效。不知道是为什么?
另外我有4个库,每个库2000张表左右,升级到5.4.1之后服务启动特别慢(不引人shardingsphere的时候启动速度2分钟左右,引入shardingsphere
5.4.0的时候启动速度5分钟左右,5.4.1启动速度达到20分钟,我把大量的表删除之后启动速度明显提升),有什么方式能加快扫描表的速度吗?
这个是我的分库策略类:DatabaseShardingAlgorithm.java
这个是我的分表策略类:TableShardingAlgorithm.java
这是我的配置内容如下:
props:
sql-show: true
dataSources:
db-0:
xxxx
db-1:
xxxx
db-2:
xxxx
db-3:
xxxx
sqlFederation:
sqlFederationEnabled: true
executionPlanCache:
initialCapacity: 1000
maximumSize: 1000
rules:
- SQL_PARSER: {}
sqlCommentParseEnabled: true
- SINGLE: {}
tables:
- '*.*'
defaultDataSource: db-0
- SHARDING: {}
tables:
tlog_transnumber_repeat:
actualDataNodes: db-${0..3}.tlog_transnumber_repeat
databaseStrategy:
standard:
shardingColumn: trans_number
shardingAlgorithmName: ds_sharding
tlog_header:
actualDataNodes: db-0.tlog_header
tableStrategy:
standard:
shardingColumn: trans_number
shardingAlgorithmName: tb_sharding
bindingTables:
- b_header,b_items
shardingAlgorithms:
ds_sharding:
type: DATABASE-MOD-SHARDING
props:
database-sharding-ranges:
db-0:0-15,db-1:16-31,db-2:32-47,db-3:48-63
tb_sharding:
type: CLASS_BASED
props:
strategy: STANDARD
algorithmClassName:
com.yonghui.yh.rme.soc.stream.consumer.sharding.algorithm.TableShardingAlgorithm
--
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]