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 2022/09/20 03:08:45 UTC

[GitHub] [shardingsphere] lwk595ww opened a new issue, #21082: 子查询外层和内层都带有分片,自定义分片返回的表明失效,导致全分片查找

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

   ![image](https://user-images.githubusercontent.com/64793990/191157657-716ecc7e-a213-48e8-a8b2-a56382877660.png)
   
   ShardingSphere版本:5.1.2
   
   Sql 语句:select t10.* from user t10  where t10.id in (select user_id from school t11 where  t11.tenantId = 'caba6901') and t10.tenantId = 'caba6901'
   
   问题描述:在子查询中,嵌套的子查询带有分片键,外层也带有分片键,能够进入自定义分片逻辑,但是自定义分片逻辑返回的表明最终没有被应用。框架最终还是全分片查找。
   
   测试情况:目前当子查询没有分片条件或外层没有分片条件,只有有分片的表会应用分片逻辑返回的表名,如果都带则自定义分片逻辑无效,全分片查找,而且是两张表的笛卡尔积。 官方文档上找到说明:当这种情况 “由内核稳定支持”。但是这样效率太低。
   
   提问:请问有什么方式可以解决这一问题,让自定义的分片逻辑也在子查询的sql上生效


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


[GitHub] [shardingsphere] lwk595ww closed issue #21082: Sub query outer layer and inner layer have shards. The returned custom shards indicate invalidity, resulting in full shard search

Posted by GitBox <gi...@apache.org>.
lwk595ww closed issue #21082: Sub query outer layer and inner layer have shards. The returned custom shards indicate invalidity, resulting in full shard search
URL: https://github.com/apache/shardingsphere/issues/21082


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


[GitHub] [shardingsphere] zhaojinchao95 commented on issue #21082: 子查询外层和内层都带有分片,自定义分片返回的表明失效,导致全分片查找

Posted by GitBox <gi...@apache.org>.
zhaojinchao95 commented on issue #21082:
URL: https://github.com/apache/shardingsphere/issues/21082#issuecomment-1253131290

   @lwk595ww Hi, it 's only support questions in English.  Please translate your issue.


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