You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2023/01/03 01:29:48 UTC

[GitHub] [shardingsphere] pengxianggui commented on issue #23128: In the official demo, if I have to use order_time as the sharding field, how do I use the binding table to avoid the Cartesian product?

pengxianggui commented on issue #23128:
URL: https://github.com/apache/shardingsphere/issues/23128#issuecomment-1369311624

   > Please show us your configuration.
   
   ```yml
   rules:
   - !SHARDING
     broadcastTables:
       - t_alarm_domain # 广播表规则列表
     bindingTables: # 绑定表规则列表。见: https://github.com/apache/shardingsphere/issues/21002
       - t_alarm,t_sensor_alarm
       - t_alarm,t_video_alarm
       - t_alarm,t_device_offline_alarm
       - t_alarm,t_alarm_handle
     tables: # 单分片键的标准分片场景
       t_alarm:
         actualDataNodes: db0.t_alarm_$->{2022..2025}
         tableStrategy:
           standard:
             shardingColumn: alarm_time
             shardingAlgorithmName: time-inline
       t_sensor_alarm:
         actualDataNodes: db0.t_sensor_alarm_$->{2022..2025}
         tableStrategy:
           standard:
             shardingColumn: alarm_time
             shardingAlgorithmName: time-inline
       t_video_alarm:
         actualDataNodes: db0.t_video_alarm_$->{2022..2025}
         tableStrategy:
           standard:
             shardingColumn: alarm_time
             shardingAlgorithmName: time-inline
       t_device_offline_alarm:
         actualDataNodes: db0.t_device_offline_alarm_$->{2022..2025}
         tableStrategy:
           standard:
             shardingColumn: alarm_time
             shardingAlgorithmName: time-inline
       t_alarm_handle:
         actualDataNodes: db0.t_alarm_handle_$->{2022..2025}
         tableStrategy:
           standard:
             shardingColumn: alarm_time
             shardingAlgorithmName: time-inline
     shardingAlgorithms:
       time-inline:
         type: CLASS_BASED
         props:
           strategy: standard
           algorithmClassName: cn.com.asoco.alarm_platform.server.sharding.AlarmTimeShardingAlgorithm # 使用自定义类实现分片逻辑处理
   ```


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org