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. 24.815 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. 2.962 105.481 ↓ 7.0 491 3 / 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. 1.614 102.519 ↓ 24.4 1,709 3 / 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. 7.846 97.462 ↓ 24.6 1,722 3 / 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. 4.402 65.658 ↓ 22.6 3,993 3 / 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. 34.819 34.819 ↓ 12.8 5,287 3 / 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. 26.437 26.437 ↓ 0.0 0 15,862 / 3

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 23.958 ↓ 0.0 0 11,979 / 3

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

10. 3.993 3.993 ↑ 1.0 1 11,979 / 3

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. 19.965 19.965 ↓ 0.0 0 11,979 / 3

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. 3.443 3.443 ↑ 1.0 1 5,165 / 3

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