Many voices. One Flagrant.

Chris Wilson

Fixing a Common N+1 Query

August 10, 2023

ActiveRecord can be so seamless, that it can make something that’s relatively costly in the DB look cheap in terms of characters you need to type. One place where this crops up is in an N+1 Query. Set the scene Let’s say we have a common “Posts” with “Comments” structure of something. Here