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

Problema das N+1 consultas no GET /produtos #8

Open
julianocanuto opened this issue Jan 1, 2022 · 0 comments
Open

Problema das N+1 consultas no GET /produtos #8

julianocanuto opened this issue Jan 1, 2022 · 0 comments

Comments

@julianocanuto
Copy link
Owner

A rota GET /produtos

Para retornar a lista de produtos com seus ingredientes, o banco de dados está sendo acessado 5x pelo Hibernate como pode ser visto na imagem abaixo.

Captura de tela evidenciando o problema

image

Referências para consulta e correção

  1. https://vladmihalcea.com/n-plus-1-query-problem/
  2. https://youtu.be/sqbqoR-lMf8
@julianocanuto julianocanuto changed the title Problema das N+1 no GET /produtos Problema das N+1 consultas no GET /produtos Jan 1, 2022
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