Saturday, February 16, 2013

Troy Hunt: 5 minute wonders: Finding lazy loading nasties with ANTS Profiler

Troy Hunt: 5 minute wonders: Finding lazy loading nasties with ANTS Profiler:
Here’s how an n+1 condition manifests itself:
  1. You query the database and get back a bunch of records in a table (this is one query)
  2. In your app code, you read through each record and refer to one or more attributes which need to be pulled from other tables
  3. Each record then causes the app to go off and make a heap of other queries in order to retrieve the attributes in the previous point (the n bit)

No comments: