explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 3dUj

Settings
# exclusive inclusive rows x rows loops node
1. 0.096 156.487 ↓ 500.0 500 1

Limit (cost=13,780.32..13,780.44 rows=1 width=382) (actual time=152.568..156.487 rows=500 loops=1)

2. 0.000 156.391 ↓ 7.1 1,000 1

Gather Merge (cost=13,763.99..13,780.32 rows=140 width=382) (actual time=152.226..156.391 rows=1,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 7.770 336.309 ↓ 7.0 490 3

Sort (cost=12,763.96..12,764.14 rows=70 width=382) (actual time=112.012..112.103 rows=490 loops=3)

  • Sort Key: bookings.id
  • Sort Method: quicksort Memory: 1259kB
4. 3.251 328.539 ↓ 24.4 1,709 3

Nested Loop (cost=1.11..12,761.82 rows=70 width=382) (actual time=0.776..109.513 rows=1,709 loops=3)

5. 22.281 314.958 ↓ 24.6 1,722 3

Nested Loop Semi Join (cost=0.84..12,728.43 rows=70 width=382) (actual time=0.728..104.986 rows=1,722 loops=3)

6. 15.023 232.782 ↓ 22.6 3,993 3

Nested Loop Anti Join (cost=0.42..11,441.75 rows=177 width=382) (actual time=0.542..77.594 rows=3,993 loops=3)

7. 154.311 154.311 ↓ 12.8 5,287 3

Parallel Seq Scan on bookings (cost=0.00..8,828.07 rows=412 width=382) (actual time=0.496..51.437 rows=5,287 loops=3)

  • Filter: ((deleted_at IS NULL) AND ((timezone('Europe/London'::text, start))::date >= '2019-09-01'::date) AND ((timezone('Europe/London'::text, start))::date <= '2019-10-03'::date))
  • Rows Removed by Filter: 60517
8. 63.448 63.448 ↓ 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.004..0.004 rows=0 loops=15,862)

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

Nested Loop (cost=0.42..7.26 rows=1 width=16) (actual time=0.005..0.005 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. 47.916 47.916 ↓ 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.004..0.004 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: 2660
Planning time : 2.715 ms
Execution time : 156.810 ms