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

[GitHub] [shardingsphere] nichengsch commented on issue #15305: shardingsphere 4.1.1 与 mybatis plus 3.4.2 整合分页的问题。

nichengsch commented on issue #15305:
URL: https://github.com/apache/shardingsphere/issues/15305#issuecomment-1527042214

   > sharding4.1.1在结合mybatis plus的时候,list方法有跑真实表,但是page方法直接走逻辑表,一般是什么原因?
   > 
   > 问题描述: 我的order 表做了分片设置为 actual-data-nodes: ds1.order_$->{["default","111111"]}, 然后我用mapper中的list查询的时候,我看到sharding的语句就有 select * from order_default 和 select * from order_111111, 但是用 page 方法查询分页的时候,因为有一个先查询total的方法,所以看到的语句是 select count(*) from order , 为什么是走 order ,而没有走 order_default 和 order_111111 这两个?
   
   > sharding4.1.1在结合mybatis plus的时候,list方法有跑真实表,但是page方法直接走逻辑表,一般是什么原因?
   > 
   > 问题描述: 我的order 表做了分片设置为 actual-data-nodes: ds1.order_$->{["default","111111"]}, 然后我用mapper中的list查询的时候,我看到sharding的语句就有 select * from order_default 和 select * from order_111111, 但是用 page 方法查询分页的时候,因为有一个先查询total的方法,所以看到的语句是 select count(*) from order , 为什么是走 order ,而没有走 order_default 和 order_111111 这两个?
   
   老哥解决了么?我这边也出现了select count(1)的前面没有走分表日志,同一个sql偶现这个状况,大多数情况是正常走分表有dosharding里面的日志。


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