-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]在多层级with情况下使用出现代码运行缓慢的问题 #46
Comments
你好, 这边发现的确存在对 等我消息. |
大佬,还有一个小问题,看能否顺便一起优化下 |
你好, 5.5.4 有优化以上2点 |
关联4个,5.5.3 2分40秒,5.5.4 1分55秒 |
你好, 5.5.5 有提升
是指的存在 根据你的代码, 在项目中的模型基类 eg : |
好的,等会我试下 5.5.5 |
提及的2个原因, 似乎有机会, 通过不改写源码实现, 以下供参考
参考 自定义关系, 使用自定义的注解, 就可以指定自定义的解析器, 那么这个自定义的解析器自然就为所欲为啦.
参考 自定义查询构造器Query方法, 其中自定义的查询构造器 ( eg : MySqlBuilderV2 ) 中的 |
我只是想获取到 BelongsToQueryRelation 类中类 belongsToTemplate 的属性,通过自定义关系,那岂不是要把BelongsToQueryRelation的所有代码都复制到我自定义的类文件中?? |
5.5.7 |
还有一个问题,通过自定义查询构造器Query方法,好像没有办法新增方法,只能重写原 builder 的方法 |
1.使用的代码库的方式 ? maven依赖
2.使用的代码库的版本 ? 5.5.3
3.java版本 23
4.框架以及版本 spring boot 3.4.0
5.数据库以及版本 mysql 5.8
6.问题简述 ( 有必要的话, 可以贴下相关调用代码以及定义代码 )
model.newQuery().with("a.b.c.d").paginate(1, 15) 运行了 3 秒,但是 sql 执行时间不超过 0.3 秒,排查发现RelationGetSupport.toObjectList 方法多次调用,model 查询出15条数据,model->a 一对多17条数据,a->b一对一16 条数据,b->c一对多1条数据,c->d一对一1条数据,该方法调用18W+次,里面还嵌套了遍历,导致代码遍历次数过多
7.预期效果
优化 RelationGetSupport.toObjectList 方法调用次数
The text was updated successfully, but these errors were encountered: