Agreed.
Naieve implementation of ORM pattern will say: GET Customers_Collection.
For each Customer in Customers_Collection, Append, GET Orders_for_customer (Customer.Customer_ID)
If you have 100 customers, that is 1 call to get the customer list (1) and 100 calls to get the orders (N), hence (N+1).
Developers tend to work with very small datasets on fast machines with local data stores so the performance issue is often not seen until regression testing or possibly UAT testing where the environment is much closer to what you would see in production. Worse, for fledgling apps then there are only 100 customers in the entire system the N+1 issue may not be apparrent, however once you are up to 10M customers, it is going to hurt!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Interesting article. ORMs often tempt you not to deal with the queries.
Agreed.
Naieve implementation of ORM pattern will say: GET Customers_Collection.
For each Customer in Customers_Collection, Append, GET Orders_for_customer (Customer.Customer_ID)
If you have 100 customers, that is 1 call to get the customer list (1) and 100 calls to get the orders (N), hence (N+1).
Developers tend to work with very small datasets on fast machines with local data stores so the performance issue is often not seen until regression testing or possibly UAT testing where the environment is much closer to what you would see in production. Worse, for fledgling apps then there are only 100 customers in the entire system the N+1 issue may not be apparrent, however once you are up to 10M customers, it is going to hurt!