explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nWHu

Settings
# exclusive inclusive rows x rows loops node
1. 0.105 2,189.860 ↑ 1.0 100 1

Limit (cost=10,500.45..10,500.70 rows=100 width=429) (actual time=2,189.749..2,189.860 rows=100 loops=1)

2. 60.693 2,189.755 ↑ 2.0 100 1

Sort (cost=10,500.45..10,500.95 rows=200 width=429) (actual time=2,189.748..2,189.755 rows=100 loops=1)

  • Sort Key: (max("*SELECT* 1".first_name)), (max("*SELECT* 1".last_name))
  • Sort Method: top-N heapsort Memory: 108kB
3. 303.271 2,129.062 ↓ 531.0 106,195 1

GroupAggregate (cost=10,410.75..10,492.81 rows=200 width=429) (actual time=1,696.858..2,129.062 rows=106,195 loops=1)

  • Group Key: "*SELECT* 1".user_handle
4. 618.016 1,825.791 ↓ 64.3 107,226 1

Sort (cost=10,410.75..10,414.92 rows=1,668 width=255) (actual time=1,696.687..1,825.791 rows=107,226 loops=1)

  • Sort Key: "*SELECT* 1".user_handle
  • Sort Method: external merge Disk: 19648kB
5. 16.610 1,207.775 ↓ 64.3 107,226 1

Append (cost=1,897.76..10,321.48 rows=1,668 width=255) (actual time=18.734..1,207.775 rows=107,226 loops=1)

6. 23.841 1,146.182 ↓ 63.2 105,154 1

Subquery Scan on *SELECT* 1 (cost=1,897.76..8,997.46 rows=1,664 width=255) (actual time=18.733..1,146.182 rows=105,154 loops=1)

7. 0.000 1,122.341 ↓ 63.2 105,154 1

Gather (cost=1,897.76..8,980.82 rows=1,664 width=255) (actual time=18.732..1,122.341 rows=105,154 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
8. 505.002 1,150.408 ↓ 50.6 35,051 3

Nested Loop (cost=897.76..7,814.42 rows=693 width=255) (actual time=9.418..1,150.408 rows=35,051 loops=3)

9. 587.873 645.393 ↓ 42.4 35,051 3

Nested Loop (cost=897.34..7,198.10 rows=826 width=148) (actual time=9.384..645.393 rows=35,051 loops=3)

10. 19.671 57.505 ↓ 19.4 35,051 3

Hash Join (cost=896.92..5,932.70 rows=1,806 width=125) (actual time=9.360..57.505 rows=35,051 loops=3)

  • Hash Cond: (m.team_id = t.id)
11. 36.083 36.083 ↑ 1.2 35,051 3

Parallel Seq Scan on members m (cost=0.00..4,926.74 rows=41,538 width=90) (actual time=7.506..36.083 rows=35,051 loops=3)

  • Filter: (plan_id = 'bank-of-america'::text)
  • Rows Removed by Filter: 40304
12. 0.849 1.751 ↓ 1.0 2,401 3

Hash (cost=866.95..866.95 rows=2,397 width=84) (actual time=1.751..1.751 rows=2,401 loops=3)

  • Buckets: 4096 Batches: 1 Memory Usage: 318kB
13. 0.624 0.902 ↓ 1.0 2,401 3

Bitmap Heap Scan on teams t (cost=86.99..866.95 rows=2,397 width=84) (actual time=0.285..0.902 rows=2,401 loops=3)

  • Recheck Cond: (plan_id = 'bank-of-america'::text)
  • Heap Blocks: exact=38
14. 0.278 0.278 ↓ 1.0 2,401 3

Bitmap Index Scan on plan_teams_name_lower_idx (cost=0.00..86.39 rows=2,397 width=0) (actual time=0.278..0.278 rows=2,401 loops=3)

  • Index Cond: (plan_id = 'bank-of-america'::text)
15. 0.015 0.015 ↑ 1.0 1 105,154

Index Scan using plan_users_pkey on plan_users pu (cost=0.42..0.70 rows=1 width=53) (actual time=0.015..0.015 rows=1 loops=105,154)

  • Index Cond: ((plan_id = 'bank-of-america'::text) AND (user_handle = m.user_handle))
16. 0.013 0.013 ↑ 1.0 1 105,154

Index Scan using users_pkey on users u (cost=0.42..0.75 rows=1 width=83) (actual time=0.013..0.013 rows=1 loops=105,154)

  • Index Cond: (user_handle = m.user_handle)
17. 0.474 44.743 ↓ 2,061.0 2,061 1

Subquery Scan on *SELECT* 2 (cost=898.18..1,220.71 rows=1 width=257) (actual time=1.198..44.743 rows=2,061 loops=1)

18. 3.057 44.269 ↓ 2,061.0 2,061 1

Nested Loop (cost=898.18..1,220.70 rows=1 width=257) (actual time=1.197..44.269 rows=2,061 loops=1)

  • Join Filter: (m_1.user_handle = u_1.user_handle)
19. 0.517 28.846 ↓ 687.0 2,061 1

Nested Loop (cost=897.75..1,218.45 rows=3 width=139) (actual time=1.172..28.846 rows=2,061 loops=1)

20. 1.048 11.841 ↓ 515.2 2,061 1

Nested Loop (cost=897.33..1,192.46 rows=4 width=116) (actual time=1.149..11.841 rows=2,061 loops=1)

21. 0.968 2.549 ↓ 22.9 2,061 1

Hash Join (cost=896.92..967.67 rows=90 width=98) (actual time=1.130..2.549 rows=2,061 loops=1)

  • Hash Cond: (m_1.team_id = t_2.id)
22. 0.521 0.521 ↑ 1.0 2,061 1

Seq Scan on managers m_1 (cost=0.00..65.34 rows=2,064 width=82) (actual time=0.016..0.521 rows=2,061 loops=1)

  • Filter: (plan_id = 'bank-of-america'::text)
  • Rows Removed by Filter: 341
23. 0.476 1.060 ↓ 1.0 2,401 1

Hash (cost=866.95..866.95 rows=2,397 width=33) (actual time=1.059..1.060 rows=2,401 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 183kB
24. 0.384 0.584 ↓ 1.0 2,401 1

Bitmap Heap Scan on teams t_2 (cost=86.99..866.95 rows=2,397 width=33) (actual time=0.207..0.584 rows=2,401 loops=1)

  • Recheck Cond: (plan_id = 'bank-of-america'::text)
  • Heap Blocks: exact=38
25. 0.200 0.200 ↓ 1.0 2,401 1

Bitmap Index Scan on plan_teams_name_lower_idx (cost=0.00..86.39 rows=2,397 width=0) (actual time=0.199..0.200 rows=2,401 loops=1)

  • Index Cond: (plan_id = 'bank-of-america'::text)
26. 8.244 8.244 ↑ 1.0 1 2,061

Index Scan using teams_pkey on teams t_1 (cost=0.41..2.50 rows=1 width=67) (actual time=0.004..0.004 rows=1 loops=2,061)

  • Index Cond: ((plan_id = 'bank-of-america'::text) AND (id = t_2.id))
27. 16.488 16.488 ↑ 1.0 1 2,061

Index Scan using plan_users_pkey on plan_users pu_1 (cost=0.42..6.50 rows=1 width=53) (actual time=0.008..0.008 rows=1 loops=2,061)

  • Index Cond: ((plan_id = 'bank-of-america'::text) AND (user_handle = m_1.user_handle))
28. 12.366 12.366 ↑ 1.0 1 2,061

Index Scan using users_pkey on users u_1 (cost=0.42..0.74 rows=1 width=83) (actual time=0.006..0.006 rows=1 loops=2,061)

  • Index Cond: (user_handle = pu_1.user_handle)
29. 0.003 0.240 ↓ 3.7 11 1

Subquery Scan on *SELECT* 3 (cost=1.26..103.31 rows=3 width=255) (actual time=0.082..0.240 rows=11 loops=1)

30. 0.017 0.237 ↓ 3.7 11 1

Nested Loop (cost=1.26..103.28 rows=3 width=255) (actual time=0.081..0.237 rows=11 loops=1)

31. 0.010 0.132 ↓ 1.4 11 1

Nested Loop (cost=0.84..98.98 rows=8 width=151) (actual time=0.058..0.132 rows=11 loops=1)

32. 0.045 0.045 ↓ 1.4 11 1

Index Scan using admins_plan_id_user_handle_unique on admins a (cost=0.41..31.46 rows=8 width=68) (actual time=0.042..0.045 rows=11 loops=1)

  • Index Cond: (plan_id = 'bank-of-america'::text)
33. 0.077 0.077 ↑ 1.0 1 11

Index Scan using users_pkey on users u_2 (cost=0.42..8.44 rows=1 width=83) (actual time=0.007..0.007 rows=1 loops=11)

  • Index Cond: (user_handle = a.user_handle)
34. 0.088 0.088 ↑ 1.0 1 11

Index Scan using plan_users_pkey on plan_users pu_2 (cost=0.42..0.54 rows=1 width=53) (actual time=0.008..0.008 rows=1 loops=11)

  • Index Cond: ((plan_id = 'bank-of-america'::text) AND (user_handle = u_2.user_handle))
Planning time : 5.229 ms
Execution time : 2,193.567 ms