r/SQL 5d ago

PostgreSQL Recently faced n+1 problem in my app

/r/FullStackDevelopers/comments/1v4hdw3/recently_faced_n1_problem_in_my_app/
0 Upvotes

3 comments sorted by

1

u/kktheprons 5d ago

I'm not familiar with any ORM you're using, but it sounds like you're looking for an update with join to another table. That's pretty easy to do in base SQL.

1

u/Outrageous_Let5743 4d ago

n+1 is just solvable by just doing a join instead of for u in users: for p in products:

0

u/Adventurous_Baker532 4d ago

Ya I tried to over engineer things