---
title: "How to Detect n+1 Queries in PHP"
url: https://daily.dev/posts/how-to-detect-n-1-queries-in-php-lfdyiscvi
source_url: https://laravel-news.com/how-to-detect-n1-queries-in-php
type: article
source: "Laravel News"
published: 2024-03-11T13:06:30.036Z
updated: 2024-05-09T08:22:04.995Z
tags: ["performance", "php"]
reading_time: 5
upvotes: 28
comments: 2
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Detect n+1 Queries in PHP

**[Laravel News](https://daily.dev/sources/ln)** · 5 min read · 28 upvotes · 2 comments

## Summary

The n+1 query problem is a performance issue in software development where unnecessary database calls are made. To detect n+1 queries, developers can use Application Performance Monitoring (APM) tools. Resolving n+1 queries can be done through techniques like eager loading, join queries, or caching.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://laravel-news.com/how-to-detect-n1-queries-in-php>

## Community discussion

Top comments from developers on daily.dev.

**@sreekeshkamath** · 0 upvotes

> Any other opensource alternatives for ScountAPM?

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 0 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#php](https://daily.dev/tags/php)

[View this post on daily.dev](https://daily.dev/posts/how-to-detect-n-1-queries-in-php-lfdyiscvi)
