explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2NwR

Settings
# exclusive inclusive rows x rows loops node
1. 0.080 176.883 ↓ 500.0 500 1

Limit (cost=14,196.54..14,196.65 rows=1 width=382) (actual time=167.240..176.883 rows=500 loops=1)

2. 0.000 176.803 ↓ 7.1 1,000 1

Gather Merge (cost=14,180.20..14,196.54 rows=140 width=382) (actual time=166.607..176.803 rows=1,000 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 8.070 370.194 ↓ 7.0 490 3

Sort (cost=13,180.18..13,180.35 rows=70 width=382) (actual time=123.224..123.398 rows=490 loops=3)

  • Sort Key: bookings.id
  • Sort Method: quicksort Memory: 1354kB
4. 3.452 362.124 ↓ 24.4 1,709 3

Nested Loop (cost=1.11..13,178.03 rows=70 width=382) (actual time=2.845..120.708 rows=1,709 loops=3)

5. 20.388 348.342 ↓ 24.6 1,722 3

Nested Loop Semi Join (cost=0.84..13,144.64 rows=70 width=382) (actual time=2.776..116.114 rows=1,722 loops=3)

6. 8.695 256.080 ↓ 22.6 3,993 3

Nested Loop Anti Join (cost=0.42..11,857.97 rows=177 width=382) (actual time=2.277..85.360 rows=3,993 loops=3)

7. 168.075 168.075 ↓ 12.8 5,287 3

Parallel Seq Scan on bookings (cost=0.00..9,244.29 rows=412 width=382) (actual time=1.584..56.025 rows=5,287 loops=3)

  • Filter: ((deleted_at IS NULL) AND ((timezone('Europe/London'::text, timezone('utc'::text, start)))::date >= '2019-09-01'::date) AND ((timezone('Europe/London'::text, timezone('utc'::text, 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: 1878
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: 2847
Planning time : 7.109 ms
Execution time : 181.635 ms