explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5zns

Settings
# exclusive inclusive rows x rows loops node
1. 931.166 12,555.770 ↑ 1.0 427,852 1

Nested Loop (cost=281,596.50..1,088,525.46 rows=427,906 width=588) (actual time=3,432.614..12,555.770 rows=427,852 loops=1)

2. 696.765 10,768.900 ↑ 1.0 427,852 1

Merge Join (cost=281,596.21..939,366.25 rows=427,906 width=574) (actual time=3,432.584..10,768.900 rows=427,852 loops=1)

  • Merge Cond: (events_venues.events_id = claims_1.events_id)
3. 1,451.220 3,984.594 ↓ 1.0 1,095,783 1

Sort (cost=281,488.16..284,216.16 rows=1,091,201 width=24) (actual time=3,432.242..3,984.594 rows=1,095,783 loops=1)

  • Sort Key: events_venues.events_id
  • Sort Method: external merge Disk: 33416kB
4. 820.620 2,533.374 ↓ 1.0 1,095,796 1

Merge Join (cost=71,445.99..149,675.42 rows=1,091,201 width=24) (actual time=703.941..2,533.374 rows=1,095,796 loops=1)

  • Merge Cond: (events_venues.venues_profiles_id = venues_profiles.id)
5. 657.754 657.754 ↓ 1.0 1,095,797 1

Index Scan using events_venues_venues_profiles_id on events_venues (cost=0.43..59,038.23 rows=1,091,201 width=8) (actual time=0.004..657.754 rows=1,095,797 loops=1)

6. 293.658 1,055.000 ↓ 6.2 1,197,298 1

Materialize (cost=71,443.78..72,404.95 rows=192,235 width=20) (actual time=703.931..1,055.000 rows=1,197,298 loops=1)

7. 206.714 761.342 ↑ 1.0 191,961 1

Sort (cost=71,443.78..71,924.37 rows=192,235 width=20) (actual time=703.926..761.342 rows=191,961 loops=1)

  • Sort Key: venues_profiles.id
  • Sort Method: external sort Disk: 6040kB
8. 234.891 554.628 ↑ 1.0 191,961 1

Merge Join (cost=4.47..50,628.24 rows=192,235 width=20) (actual time=0.085..554.628 rows=191,961 loops=1)

  • Merge Cond: (venues_profiles.venues_id = venues.id)
9. 76.297 76.297 ↑ 1.0 192,100 1

Index Scan using venues_profiles_venues_id on venues_profiles (cost=0.42..6,712.55 rows=192,235 width=8) (actual time=0.006..76.297 rows=192,100 loops=1)

10. 243.440 243.440 ↑ 1.0 446,528 1

Index Scan using venues_pkey on venues (cost=0.42..40,667.20 rows=452,968 width=20) (actual time=0.004..243.440 rows=446,528 loops=1)

11. 426.906 6,087.541 ↑ 1.0 427,852 1

Materialize (cost=92.92..647,719.51 rows=427,906 width=558) (actual time=0.240..6,087.541 rows=427,852 loops=1)

12. 559.433 5,660.635 ↑ 1.0 427,852 1

Nested Loop Left Join (cost=92.92..646,649.75 rows=427,906 width=558) (actual time=0.231..5,660.635 rows=427,852 loops=1)

13. 581.581 4,245.498 ↑ 1.0 427,852 1

Nested Loop (cost=92.49..342,120.52 rows=427,906 width=554) (actual time=0.216..4,245.498 rows=427,852 loops=1)

14. 346.092 3,236.065 ↑ 1.0 427,852 1

Nested Loop (cost=92.35..269,356.50 rows=427,906 width=546) (actual time=0.206..3,236.065 rows=427,852 loops=1)

15. 819.890 2,034.269 ↑ 1.0 427,852 1

Merge Join (cost=92.07..139,821.52 rows=427,906 width=514) (actual time=0.187..2,034.269 rows=427,852 loops=1)

  • Merge Cond: (claims_1.events_id = events.id)
16. 423.806 423.806 ↑ 1.0 427,852 1

Index Scan using claims_events_id_idx on claims claims_1 (cost=0.42..47,946.94 rows=427,906 width=459) (actual time=0.015..423.806 rows=427,852 loops=1)

17. 790.573 790.573 ↓ 1.2 1,267,506 1

Index Scan using events_pkey on events (cost=0.43..83,781.01 rows=1,099,375 width=55) (actual time=0.009..790.573 rows=1,267,506 loops=1)

18. 855.704 855.704 ↑ 1.0 1 427,852

Index Scan using programs_pkey on programs (cost=0.28..0.29 rows=1 width=36) (actual time=0.001..0.002 rows=1 loops=427,852)

  • Index Cond: (id = events.programs_id)
19. 427.852 427.852 ↑ 1.0 1 427,852

Index Scan using payroll_periods_pkey on payroll_periods (cost=0.14..0.16 rows=1 width=12) (actual time=0.001..0.001 rows=1 loops=427,852)

  • Index Cond: (id = claims_1.payroll_periods_id)
20. 855.704 855.704 ↑ 1.0 1 427,852

Index Scan using events_staffing_days_positions_pkey on events_staffing_days_positions (cost=0.43..0.70 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=427,852)

  • Index Cond: (claims_1.events_staffing_days_positions_id = id)
21. 855.704 855.704 ↑ 1.0 1 427,852

Index Scan using staffing_users_pkey on staffing_users (cost=0.29..0.33 rows=1 width=18) (actual time=0.002..0.002 rows=1 loops=427,852)

  • Index Cond: (id = claims_1.staffing_users_id)