N + 1 Query Problem and the Solution
What is N + 1 problem?
In simple terms, the N + 1 query problem happens when you:
Run 1 query to fetch a list of records
Then, for each of those N records, you run another query.
That’s why it’s called N + 1: one main query plus N additional quer...
waltertayarg.hashnode.dev2 min read