explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6MuS

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

Merge Join (cost=1,500,244.11..1,512,221.97 rows=427,906 width=588) (actual time=13,075.153..14,200.089 rows=427,852 loops=1)

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

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

  • Sort Key: staffing_users.id
  • Sort Method: quicksort Memory: 4060kB
3. 15.704 15.704 ↑ 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.704 rows=42,116 loops=1)

4. 194.184 13,450.468 ↑ 1.0 427,852 1

Materialize (cost=1,494,470.97..1,496,610.50 rows=427,906 width=574) (actual time=13,038.301..13,450.468 rows=427,852 loops=1)

5. 1,043.784 13,256.284 ↑ 1.0 427,852 1

Sort (cost=1,494,470.97..1,495,540.73 rows=427,906 width=574) (actual time=13,038.293..13,256.284 rows=427,852 loops=1)

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

Merge Join (cost=1,227,568.17..1,235,059.92 rows=427,906 width=574) (actual time=11,154.816..12,212.500 rows=427,852 loops=1)

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

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

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

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

9. 407.381 11,849.320 ↑ 1.0 427,852 1

Materialize (cost=1,227,476.12..1,229,615.65 rows=427,906 width=542) (actual time=11,154.142..11,849.320 rows=427,852 loops=1)

10. 1,222.257 11,441.939 ↑ 1.0 427,852 1

Sort (cost=1,227,476.12..1,228,545.89 rows=427,906 width=542) (actual time=11,154.128..11,441.939 rows=427,852 loops=1)

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

Merge Join (cost=875,052.06..979,762.07 rows=427,906 width=542) (actual time=7,203.291..10,219.682 rows=427,852 loops=1)

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

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

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

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

  • Sort Key: events_venues.events_id
  • Sort Method: external merge Disk: 33416kB
14. 813.246 2,530.638 ↓ 1.0 1,095,796 1

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

  • Merge Cond: (events_venues.venues_profiles_id = venues_profiles.id)
15. 678.154 678.154 ↓ 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.008..678.154 rows=1,095,797 loops=1)

16. 291.887 1,039.238 ↓ 6.2 1,197,298 1

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

17. 204.465 747.351 ↑ 1.0 191,961 1

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

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

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

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

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

21. 198.574 4,200.588 ↑ 1.0 427,852 1

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

22. 844.569 4,002.014 ↑ 1.0 427,852 1

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

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

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

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

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

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

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

26. 314.103 2,827.271 ↑ 1.0 427,852 1

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

27. 801.975 2,513.168 ↑ 1.0 427,852 1

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

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

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

  • Merge Cond: (claims_1.events_staffing_days_positions_id = events_staffing_days_positions.id)
29. 369.483 369.483 ↑ 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.013..369.483 rows=427,852 loops=1)

30. 608.831 608.831 ↓ 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.006..608.831 rows=1,281,239 loops=1)

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