explain.depesz.com

PostgreSQL's explain analyze made readable

Result: eKCG

Settings
# exclusive inclusive rows x rows loops node
1. 0.086 130.382 ↓ 500.0 500 1

Limit (cost=13,364.11..13,364.22 rows=1 width=382) (actual time=122.655..130.382 rows=500 loops=1)

2. 0.000 130.296 ↓ 7.1 1,000 1

Gather Merge (cost=13,347.77..13,364.11 rows=140 width=382) (actual time=121.818..130.296 rows=1,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 8.886 316.443 ↓ 7.0 491 3

Sort (cost=12,347.75..12,347.92 rows=70 width=382) (actual time=105.251..105.481 rows=491 loops=3)

  • Sort Key: bookings.id
  • Sort Method: quicksort Memory: 1063kB
4. 4.841 307.557 ↓ 24.4 1,709 3

Nested Loop (cost=1.11..12,345.60 rows=70 width=382) (actual time=0.735..102.519 rows=1,709 loops=3)

5. 23.538 292.386 ↓ 24.6 1,722 3

Nested Loop Semi Join (cost=0.84..12,312.21 rows=70 width=382) (actual time=0.695..97.462 rows=1,722 loops=3)

6. 13.207 196.974 ↓ 22.6 3,993 3

Nested Loop Anti Join (cost=0.42..11,025.54 rows=177 width=382) (actual time=0.479..65.658 rows=3,993 loops=3)

7. 104.457 104.457 ↓ 12.8 5,287 3

Parallel Seq Scan on bookings (cost=0.00..8,411.86 rows=412 width=382) (actual time=0.071..34.819 rows=5,287 loops=3)

  • Filter: ((deleted_at IS NULL) AND ((start)::date >= '2019-09-01'::date) AND ((start)::date <= '2019-10-03'::date))
  • Rows Removed by Filter: 60517
8. 79.310 79.310 ↓ 0.0 0 15,862

Index Only Scan using invoice_item_groups_model_type_model_id_index on invoice_item_groups (cost=0.42..6.35 rows=1 width=16) (actual time=0.005..0.005 rows=0 loops=15,862)

  • Index Cond: ((model_type = 'App\Models\Booking'::text) AND (model_id = bookings.id))
  • Heap Fetches: 1718
9. 0.000 71.874 ↓ 0.0 0 11,979

Nested Loop (cost=0.42..7.26 rows=1 width=16) (actual time=0.006..0.006 rows=0 loops=11,979)

10. 11.979 11.979 ↑ 1.0 1 11,979

Seq Scan on teams (cost=0.00..1.05 rows=1 width=90) (actual time=0.001..0.001 rows=1 loops=11,979)

  • Filter: ((deleted_at IS NULL) AND ((id)::text = '8b579d17-dd73-42aa-9679-10e59f921a74'::text))
  • Rows Removed by Filter: 3
11. 59.895 59.895 ↓ 0.0 0 11,979

Index Scan using booking_teams_booking_id_index on booking_teams (cost=0.42..6.20 rows=1 width=53) (actual time=0.005..0.005 rows=0 loops=11,979)

  • Index Cond: (booking_id = bookings.id)
  • Filter: ((team_id)::text = '8b579d17-dd73-42aa-9679-10e59f921a74'::text)
  • Rows Removed by Filter: 1
12. 10.330 10.330 ↑ 1.0 1 5,165

Index Only Scan using clients_pkey on clients (cost=0.28..0.48 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=5,165)

  • Index Cond: (id = bookings.client_id)
  • Heap Fetches: 2247
Planning time : 1.114 ms
Execution time : 130.527 ms