Skip to content
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

2018年06月30日 数据查询的 N+1 问题 #39

Open
imzyf opened this issue Jun 30, 2018 · 0 comments
Open

2018年06月30日 数据查询的 N+1 问题 #39

imzyf opened this issue Jun 30, 2018 · 0 comments

Comments

@imzyf
Copy link
Contributor

imzyf commented Jun 30, 2018

N+1 查询问题 就是查询扩展字段时的循环查询问题。

为了解决 N+1 问题我使用了模型 预加载 方式,但是由于后台框架限制(也可能是使用不当),将 一对多 的被关联的模型数据都查出来了,数据量很大,导致页面卡顿,一次反向优化。

优化要权衡不能硬搬书本。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant