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

【文章推荐】EF Core 代码性能优化建议 #755

Closed
gaufung opened this issue Nov 6, 2024 · 1 comment
Closed

【文章推荐】EF Core 代码性能优化建议 #755

gaufung opened this issue Nov 6, 2024 · 1 comment

Comments

@gaufung
Copy link
Collaborator

gaufung commented Nov 6, 2024

https://dev.to/antonmartyniuk/how-to-increase-ef-core-performance-for-read-queries-in-net-2fk9

@gaufung
Copy link
Collaborator Author

gaufung commented Nov 29, 2024

EF Core 查询优化建议:

  1. 创建索引
  2. 优化查询投影
  3. 对于只读查询,使用 AsNoTracking
  4. 使用积极加载 (Eager Loading)
  5. 使用分页查询结果
  6. 使用编译查询
  7. 使用 SplitQuery 避免迪尔卡乘积爆炸
  8. 使用原生 Sql 语句查询
  9. 引入缓存

@gaufung gaufung closed this as completed Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant