How to Avoid the N+1 Query Problem With  Eager Loading

How to Avoid the N+1 Query Problem With Eager Loading

In this post, I will define the N+1 query problem and explain how to avoid it using eager loading. Throughout my professional career, I have enhanced the response time of numerous APIs by refactoring N+1 queries. I have seen the N+1 issue in many times that use ORMs, as well as in those that use raw queries. In this blog post, I will use raw queries to demonstrate the N+1 problem and Eager Loading to solve it....

September 11, 2024 · 7 min · 1454 words · Prakash Bhandari
Find MySQL 8.3 keywords and reserved words used in column names, table names, procedures, or functions

Find MySQL 8.3 keywords and reserved words used as column names, table names, procedures, or functions

Sometimes, you may see raw queries in your codebase, especially when dealing with very old codebases. Nowadays, people tend to use ORMs (Object-Relational Mapping). It’s possible that in the past, developers used table names, column names, or function names that are now considered keywords by newer versions of MySQL. In such cases, upgrading from an older MySQL version to a newer one (for example, from MySQL 5.7 to 8.x) can be challenging if your codebase uses raw queries without proper escaping for table names, column names, or function names in the queries....

April 4, 2024 · 3 min · 588 words · Prakash Bhandari