We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
apijson版本:6.2.0 数据库:mysql 8.0.21 JDK/基础库: 1.8.0_17 OS/系统:win11 问题描述: 两表数据都在1600条左右、结果也是1600条左右,一对一关系,且增加redis对联表查询的速度差不多,求大佬解惑 附图:
The text was updated successfully, but these errors were encountered:
但是将redis去除之后反而快很多
Sorry, something went wrong.
APIJSON 性能是有测试过的,包括在腾讯的项目中实际表现也很好: https://github.com/Tencent/APIJSON/releases/tag/5.1.5
Redis 如果没部署(连接耗时,超时才有结果),或者不在本机部署(网络耗时),光连 Redis 查询就会很耗时。
你现在这种写法 1.首先引用赋值(外键关联)写法就错了 "id>": "/Srctions/router_id" 对应 WHERE id > '/Srctions/router_id' 结果可能是扫全表然后查不到值
id
应该改成 "id@": "/Srctions/router_id"
可以加 @Explain: true 或者在控制台日志查看生成和执行的 SQL。
建议多看看 通用文档 和 测试用例
2.其次如果写对了,那也是 N+1 次查询,大数据量下性能确实差,需要改成 JOIN,可以试试 APP JOIN 和 LEFT/INNER JOIN #374
3.最后 Log.DEBUG = true(默认 false) 时,打印日志对性能会有明显影响,可以关掉后再测试
1.如果写法改为"id@": "/Srctions/router_id" sql会执行多次,会和数据量无限叠加,速度更慢
用 JOIN
No branches or pull requests
Description
apijson版本:6.2.0
数据库:mysql 8.0.21
JDK/基础库: 1.8.0_17
OS/系统:win11
问题描述:
两表数据都在1600条左右、结果也是1600条左右,一对一关系,且增加redis对联表查询的速度差不多,求大佬解惑
附图:
The text was updated successfully, but these errors were encountered: