Laravel Vitals
Toggle theme
N+1 query pattern detected

N+1 query patterns repeat the same SQL many times per request. See per-route patterns and affected URLs in the Database queries page.

View database queries

N+1 query pattern detected

Warning

A query pattern repeated above the configured threshold during this audit.

n-plus-one-detected
60
occurrences

N+1 queries happen when accessing a relation inside a loop without eager loading. Each iteration triggers a separate SQL query — 100 items = 101 queries.

Typical savings: cuts query count by 90%, 200-1500ms TTFB improvement

Where this happens

60
blog
View URL
Sat, May 23, 2026 12:58 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sat, May 23, 2026 12:57 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 24, 2026 12:36 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 24, 2026 12:35 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 25, 2026 12:11 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 25, 2026 12:10 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 26, 2026 12:11 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 26, 2026 12:12 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, May 20, 2026 12:14 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, May 20, 2026 12:13 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, May 21, 2026 12:25 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, May 21, 2026 12:24 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 22, 2026 12:06 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 22, 2026 12:05 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sat, May 16, 2026 12:36 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sat, May 16, 2026 12:36 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 17, 2026 12:53 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 17, 2026 12:53 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 18, 2026 12:47 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 18, 2026 12:46 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 19, 2026 12:43 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 19, 2026 12:42 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, May 13, 2026 12:29 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, May 13, 2026 12:30 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, May 14, 2026 12:01 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, May 14, 2026 12:01 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 15, 2026 12:54 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 15, 2026 12:53 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sat, May 9, 2026 12:54 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sat, May 9, 2026 12:53 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 10, 2026 12:15 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 10, 2026 12:14 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 11, 2026 12:32 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 11, 2026 12:32 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 12, 2026 12:52 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 12, 2026 12:52 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, May 6, 2026 12:38 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, May 6, 2026 12:38 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, May 7, 2026 12:33 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, May 7, 2026 12:32 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 8, 2026 12:08 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 8, 2026 12:08 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 1, 2026 12:12 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sat, May 2, 2026 12:51 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sat, May 2, 2026 12:52 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 3, 2026 12:46 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Sun, May 3, 2026 12:45 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 4, 2026 12:34 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, May 4, 2026 12:33 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 5, 2026 12:44 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, May 5, 2026 12:45 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, Apr 28, 2026 12:54 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Tue, Apr 28, 2026 12:54 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, Apr 29, 2026 12:10 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Wed, Apr 29, 2026 12:09 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, Apr 30, 2026 12:04 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Thu, Apr 30, 2026 12:04 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Fri, May 1, 2026 12:11 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, Apr 27, 2026 12:00 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Mon, Apr 27, 2026 12:00 PM
View audit

Repeated queries

  • SELECT * FROM posts WHERE user_id = ?
    ×24 app/Http/Controllers/BlogController.php:42
  • SELECT * FROM comments WHERE post_id = ?
    ×18 app/View/Components/PostCard.php:18
Recommended
// Eager-load the relationship
$users = User::with('posts')->get();
foreach ($users as $user) {
    echo $user->posts->count();
}
Avoid
// 1 + N queries — fires a SELECT for each user
$users = User::all();
foreach ($users as $user) {
    echo $user->posts->count();
}
Open Vitals Spotlight (Cmd+K)
Open Vitals Spotlight (Ctrl+K)
Type at least 2 characters to search
↑↓ Navigate Open
0 results