explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Hqq

Settings
# exclusive inclusive rows x rows loops node
1. 700.548 14,009.493 ↑ 1.0 427,852 1

Merge Join (cost=1,500,244.04..1,512,221.89 rows=427,906 width=588) (actual time=12,881.659..14,009.493 rows=427,852 loops=1)

  • Merge Cond: (staffing_users.id = claims_1.staffing_users_id)
2. 34.432 50.421 ↑ 1.0 42,100 1

Sort (cost=5,773.11..5,878.40 rows=42,116 width=18) (actual time=37.364..50.421 rows=42,100 loops=1)

  • Sort Key: staffing_users.id
  • Sort Method: quicksort Memory: 4060kB
3. 15.989 15.989 ↑ 1.0 42,116 1

Seq Scan on staffing_users (cost=0.00..2,538.16 rows=42,116 width=18) (actual time=0.005..15.989 rows=42,116 loops=1)

4. 193.660 13,258.524 ↑ 1.0 427,852 1

Materialize (cost=1,494,470.89..1,496,610.42 rows=427,906 width=574) (actual time=12,844.220..13,258.524 rows=427,852 loops=1)

5. 1,058.762 13,064.864 ↑ 1.0 427,852 1

Sort (cost=1,494,470.89..1,495,540.65 rows=427,906 width=574) (actual time=12,844.214..13,064.864 rows=427,852 loops=1)

  • Sort Key: claims_1.staffing_users_id
  • Sort Method: external merge Disk: 129112kB
6. 363.618 12,006.102 ↑ 1.0 427,852 1

Merge Join (cost=1,227,568.09..1,235,059.84 rows=427,906 width=574) (actual time=10,954.892..12,006.102 rows=427,852 loops=1)

  • Merge Cond: (programs.id = events.programs_id)
7. 0.572 0.927 ↑ 1.0 679 1

Sort (cost=92.05..93.76 rows=684 width=36) (actual time=0.643..0.927 rows=679 loops=1)

  • Sort Key: programs.id
  • Sort Method: quicksort Memory: 86kB
8. 0.355 0.355 ↑ 1.0 683 1

Seq Scan on programs (cost=0.00..59.84 rows=684 width=36) (actual time=0.002..0.355 rows=683 loops=1)

9. 402.663 11,641.557 ↑ 1.0 427,852 1

Materialize (cost=1,227,476.04..1,229,615.57 rows=427,906 width=542) (actual time=10,954.230..11,641.557 rows=427,852 loops=1)

10. 1,181.895 11,238.894 ↑ 1.0 427,852 1

Sort (cost=1,227,476.04..1,228,545.81 rows=427,906 width=542) (actual time=10,954.222..11,238.894 rows=427,852 loops=1)

  • Sort Key: events.programs_id
  • Sort Method: external merge Disk: 114824kB
11. 663.485 10,056.999 ↑ 1.0 427,852 1

Merge Join (cost=875,052.06..979,761.99 rows=427,906 width=542) (actual time=7,116.099..10,056.999 rows=427,852 loops=1)

  • Merge Cond: (claims_1.events_id = events.id)
12. 655.417 8,679.251 ↑ 1.0 427,852 1

Merge Join (cost=874,960.41..887,887.50 rows=427,906 width=495) (actual time=7,115.953..8,679.251 rows=427,852 loops=1)

  • Merge Cond: (events_venues.events_id = claims_1.events_id)
13. 1,379.311 3,889.347 ↓ 1.0 1,095,783 1

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

  • Sort Key: events_venues.events_id
  • Sort Method: external merge Disk: 33416kB
14. 809.692 2,510.036 ↓ 1.0 1,095,797 1

Merge Join (cost=71,445.99..149,675.42 rows=1,091,201 width=24) (actual time=689.889..2,510.036 rows=1,095,797 loops=1)

  • Merge Cond: (events_venues.venues_profiles_id = venues_profiles.id)
15. 663.578 663.578 ↓ 1.0 1,095,798 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.007..663.578 rows=1,095,798 loops=1)

16. 290.986 1,036.766 ↓ 6.2 1,197,299 1

Materialize (cost=71,443.78..72,404.95 rows=192,235 width=20) (actual time=689.879..1,036.766 rows=1,197,299 loops=1)

17. 206.067 745.780 ↑ 1.0 191,961 1

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

  • Sort Key: venues_profiles.id
  • Sort Method: external sort Disk: 6040kB
18. 228.022 539.713 ↑ 1.0 191,961 1

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

  • Merge Cond: (venues_profiles.venues_id = venues.id)
19. 72.413 72.413 ↑ 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.008..72.413 rows=192,100 loops=1)

20. 239.278 239.278 ↑ 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.006..239.278 rows=446,528 loops=1)

21. 195.426 4,134.487 ↑ 1.0 427,852 1

Materialize (cost=593,457.11..595,596.64 rows=427,906 width=471) (actual time=3,706.184..4,134.487 rows=427,852 loops=1)

22. 836.212 3,939.061 ↑ 1.0 427,852 1

Sort (cost=593,457.11..594,526.87 rows=427,906 width=471) (actual time=3,706.177..3,939.061 rows=427,852 loops=1)

  • Sort Key: claims_1.events_id
  • Sort Method: external merge Disk: 93776kB
23. 336.564 3,102.849 ↑ 1.0 427,852 1

Merge Join (cost=364,581.14..372,070.06 rows=427,906 width=471) (actual time=2,235.198..3,102.849 rows=427,852 loops=1)

  • Merge Cond: (payroll_periods.id = claims_1.payroll_periods_id)
24. 0.104 0.151 ↑ 1.0 120 1

Sort (cost=8.34..8.64 rows=120 width=12) (actual time=0.091..0.151 rows=120 loops=1)

  • Sort Key: payroll_periods.id
  • Sort Method: quicksort Memory: 30kB
25. 0.047 0.047 ↓ 1.0 121 1

Seq Scan on payroll_periods (cost=0.00..4.20 rows=120 width=12) (actual time=0.008..0.047 rows=121 loops=1)

26. 317.929 2,766.134 ↑ 1.0 427,852 1

Materialize (cost=364,572.77..366,712.30 rows=427,906 width=463) (actual time=2,235.091..2,766.134 rows=427,852 loops=1)

27. 790.549 2,448.205 ↑ 1.0 427,852 1

Sort (cost=364,572.77..365,642.53 rows=427,906 width=463) (actual time=2,235.088..2,448.205 rows=427,852 loops=1)

  • Sort Key: claims_1.payroll_periods_id
  • Sort Method: external merge Disk: 89632kB
28. 734.700 1,657.656 ↑ 1.0 427,852 1

Merge Left Join (cost=73.12..146,111.72 rows=427,906 width=463) (actual time=0.047..1,657.656 rows=427,852 loops=1)

  • Merge Cond: (claims_1.events_staffing_days_positions_id = events_staffing_days_positions.id)
29. 333.726 333.726 ↑ 1.0 427,852 1

Index Scan using claims_events_staffing_days_positions_id_primary_claim on claims claims_1 (cost=0.42..59,909.69 rows=427,906 width=459) (actual time=0.018..333.726 rows=427,852 loops=1)

30. 589.230 589.230 ↓ 1.1 1,281,239 1

Index Scan using events_staffing_days_positions_pkey on events_staffing_days_positions (cost=0.43..78,011.99 rows=1,138,999 width=8) (actual time=0.011..589.230 rows=1,281,239 loops=1)

31. 714.263 714.263 ↓ 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.018..714.263 rows=1,267,506 loops=1)