You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "qiuweilu (via GitHub)" <gi...@apache.org> on 2023/10/22 13:13:28 UTC

[I] How to set the determined table name after configuring the table splitting strategy [shardingsphere]

qiuweilu opened a new issue, #28838:
URL: https://github.com/apache/shardingsphere/issues/28838

           <dependency>
               <groupId>org.apache.shardingsphere</groupId>
               <artifactId>shardingsphere-jdbc-core</artifactId>
               <version>5.4.1</version>
           </dependency>
   --------------------------------------------------------------------------------
   rules:
     - !SINGLE
       tables:
         - "*.*"
     - !SHARDING
       tables:
         part_cmnt:
           actualDataNodes: ds_0.part_cmnt_${0..9}
           tableStrategy:
             standard:
               shardingColumn: part_fkid
               shardingAlgorithmName: t_cmnt_inline
   
       shardingAlgorithms:
         t_media_inline:
           type: INLINE
           props:
             algorithm-expression: part_cmnt_${part_fkid % 10}
   ----------------------------------------------------------------------------------------------------------------------------------
   
   ```
           SELECT out_cmnt.*, vote_bind_tab.*, vote_user_tab.*
           FROM
           (
               SELECT cmnt_tab.*, label vote_label
               FROM
               (
                   <!-- 基础.评论数据 -->
                   SELECT base_cmnt.* FROM part_cmnt base_cmnt
                   WHERE base_cmnt.part_fkid = #{partFkid,jdbcType=BIGINT}
                   AND base_cmnt.cmnt_del = 0
                   ORDER BY base_cmnt.cmnt_id DESC
                   LIMIT 1000
               ) cmnt_tab
               <!-- 评论.点赞数据 -->
               LEFT JOIN part_vote vote_bind_tab ON vote_bind_tab.bind_fkid = cmnt_tab.cmnt_id
               AND vote_bind_tab.part_fkid = #{partFkid,jdbcType=BIGINT}
               GROUP BY cmnt_tab.cmnt_id
           ) out_cmnt
   		LEFT JOIN part_vote vote_user_tab ON vote_user_tab.bind_fkid = out_cmnt.cmnt_id
   		AND vote_user_tab.user_id = #{userId,jdbcType=BIGINT}
   		GROUP BY out_cmnt.cmnt_id
   ```
   part_cmnt ,  part_vote 都是分表, 我怎么才能手动指定数据表名, 如part_cmnt_1, 当我这么指定时候就报错,说part_cmnt_1不存在,如果我不手动指定数据表名,就会执行M0-M9 * N0-N9 * X0-X9次查询。
   
   
   
   
   


-- 
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.apache.org

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


Re: [I] How to set the determined table name after configuring the table splitting strategy [shardingsphere]

Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu commented on issue #28838:
URL: https://github.com/apache/shardingsphere/issues/28838#issuecomment-1776460247

   @terrymanu How to manually specify a table name after defining a table splitting strategy


-- 
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


Re: [I] How to set the determined table name after configuring the table splitting strategy [shardingsphere]

Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu commented on issue #28838:
URL: https://github.com/apache/shardingsphere/issues/28838#issuecomment-1774754168

   @strongduanmu 
   Has the table splitting strategy been defined, does it still support manually defining table names
   


-- 
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


Re: [I] How to set the determined table name after configuring the table splitting strategy. M*N times query. [shardingsphere]

Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu closed issue #28838: How to set the determined table name after configuring the table splitting strategy.  M*N times query.
URL: https://github.com/apache/shardingsphere/issues/28838


-- 
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


Re: [I] How to set the determined table name after configuring the table splitting strategy. M*N times query. [shardingsphere]

Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu commented on issue #28838:
URL: https://github.com/apache/shardingsphere/issues/28838#issuecomment-1780389022

   @RaigorJiang Can someone give a response


-- 
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


Re: [I] How to set the determined table name after configuring the table splitting strategy. M*N times query. [shardingsphere]

Posted by "qiuweilu (via GitHub)" <gi...@apache.org>.
qiuweilu commented on issue #28838:
URL: https://github.com/apache/shardingsphere/issues/28838#issuecomment-1778378523

   @strongduanmu  Can someone give a response and whether it can be achieved


-- 
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