Mybatis-PageHelper icon indicating copy to clipboard operation
Mybatis-PageHelper copied to clipboard

严重BUG,使用sqlserver时,分页查询因为ORDER BY前的空行导致查询缓慢的问题

Open trifolium-x opened this issue 2 months ago • 8 comments

异常模板

image 在使用sqlserver数据库使用方言sqlserver2012的时候,当模板的ORDER BY前有空行的时候查询非常慢以至于很多时候查不出来, 当去掉ORDER BY前面的空行时速度就很正常。现在不知道是Pagehelper还是Mybatis的BUG, 我使用的框架是TkMybatis和Pagehelper的组合。

经过测试,在查询最后一页时触发该问题

Page<xxx> page = PageHelper.startPage(ro.getPageIndex(), ro.getPageSize(),
                totalCount == null)) {
            page.doSelectPage(() -> xxxMapper.getxxx(xxx);

trifolium-x avatar Jun 14 '24 06:06 trifolium-x