explain.depesz.com

PostgreSQL's explain analyze made readable

Result: R3Ny

Settings
# exclusive inclusive rows x rows loops node
1. 0.082 17.825 ↑ 1.8 73 1

Sort (cost=36,778.28..36,778.61 rows=131 width=178) (actual time=17.817..17.825 rows=73 loops=1)

  • Sort Key: board_page_alias.updated_at DESC, board_page_alias.id DESC
  • Sort Method: quicksort Memory: 59kB
2. 0.116 17.743 ↑ 1.8 73 1

Hash Right Join (cost=4,416.95..36,773.67 rows=131 width=178) (actual time=14.234..17.743 rows=73 loops=1)

  • Hash Cond: (personal_board.board_id = board_page_alias.id)
3. 0.032 1.142 ↑ 358.0 1 1

GroupAggregate (cost=399.92..407.98 rows=358 width=48) (actual time=1.142..1.142 rows=1 loops=1)

  • Group Key: personal_board.board_id
4. 0.011 1.110 ↑ 358.0 1 1

Sort (cost=399.92..400.82 rows=358 width=134) (actual time=1.110..1.110 rows=1 loops=1)

  • Sort Key: personal_board.board_id
  • Sort Method: quicksort Memory: 25kB
5. 0.004 1.099 ↑ 358.0 1 1

Nested Loop Left Join (cost=135.74..384.74 rows=358 width=134) (actual time=1.091..1.099 rows=1 loops=1)

6. 0.044 1.086 ↑ 358.0 1 1

Hash Join (cost=135.45..198.96 rows=358 width=32) (actual time=1.078..1.086 rows=1 loops=1)

  • Hash Cond: (workspace_member.account_id = personal_board.account_id)
7. 0.029 0.048 ↑ 1.1 13 1

Bitmap Heap Scan on workspace_member (cost=4.40..50.48 rows=14 width=16) (actual time=0.029..0.048 rows=13 loops=1)

  • Recheck Cond: (workspace_id = '1f32d99e-2062-43cb-b9a8-7ae13ab7c977'::uuid)
  • Filter: ((member_role <> 'sysadmin'::text) AND (status = 'active'::text))
  • Rows Removed by Filter: 2
  • Heap Blocks: exact=12
8. 0.019 0.019 ↑ 1.0 15 1

Bitmap Index Scan on team_member_team_id_account_id_key (cost=0.00..4.40 rows=15 width=0) (actual time=0.019..0.019 rows=15 loops=1)

  • Index Cond: (workspace_id = '1f32d99e-2062-43cb-b9a8-7ae13ab7c977'::uuid)
9. 0.632 0.994 ↓ 1.0 4,365 1

Hash (cost=77.69..77.69 rows=4,269 width=32) (actual time=0.994..0.994 rows=4,365 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 337kB
10. 0.362 0.362 ↓ 1.0 4,365 1

Seq Scan on personal_board (cost=0.00..77.69 rows=4,269 width=32) (actual time=0.009..0.362 rows=4,365 loops=1)

11. 0.009 0.009 ↑ 1.0 1 1

Index Scan using account_pkey on account (cost=0.28..0.51 rows=1 width=118) (actual time=0.009..0.009 rows=1 loops=1)

  • Index Cond: (id = personal_board.account_id)
12. 0.029 13.054 ↑ 1.0 73 1

Hash (cost=4,016.11..4,016.11 rows=73 width=114) (actual time=13.054..13.054 rows=73 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
13. 0.014 13.025 ↑ 1.0 73 1

Subquery Scan on board_page_alias (cost=4,015.20..4,016.11 rows=73 width=114) (actual time=12.997..13.025 rows=73 loops=1)

14. 0.009 13.011 ↑ 1.0 73 1

Limit (cost=4,015.20..4,015.38 rows=73 width=114) (actual time=12.995..13.011 rows=73 loops=1)

15. 3.348 13.002 ↑ 199.4 73 1

Sort (cost=4,015.20..4,051.60 rows=14,558 width=114) (actual time=12.994..13.002 rows=73 loops=1)

  • Sort Key: reel.updated_at DESC, reel.id DESC
  • Sort Method: top-N heapsort Memory: 38kB
16. 3.266 9.654 ↑ 1.1 13,454 1

Hash Left Join (cost=697.11..3,491.85 rows=14,558 width=114) (actual time=2.377..9.654 rows=13,454 loops=1)

  • Hash Cond: (reel.id = is_in_board_subquery.board_id)
17. 4.249 6.195 ↑ 1.1 13,454 1

Bitmap Heap Scan on reel (cost=649.24..3,389.22 rows=14,558 width=113) (actual time=2.180..6.195 rows=13,454 loops=1)

  • Recheck Cond: (workspace_id = '1f32d99e-2062-43cb-b9a8-7ae13ab7c977'::uuid)
  • Heap Blocks: exact=1909
18. 1.946 1.946 ↑ 1.1 13,454 1

Bitmap Index Scan on reel_workspace_id_index (cost=0.00..645.60 rows=14,558 width=0) (actual time=1.946..1.946 rows=13,454 loops=1)

  • Index Cond: (workspace_id = '1f32d99e-2062-43cb-b9a8-7ae13ab7c977'::uuid)
19. 0.026 0.193 ↓ 1.0 143 1

Hash (cost=46.09..46.09 rows=142 width=17) (actual time=0.192..0.193 rows=143 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
20. 0.015 0.167 ↓ 1.0 143 1

Subquery Scan on is_in_board_subquery (cost=42.89..46.09 rows=142 width=17) (actual time=0.132..0.167 rows=143 loops=1)

21. 0.065 0.152 ↓ 1.0 143 1

HashAggregate (cost=42.89..44.67 rows=142 width=17) (actual time=0.132..0.152 rows=143 loops=1)

  • Group Key: personal_board_1.board_id
22. 0.056 0.087 ↑ 1.0 143 1

Bitmap Heap Scan on personal_board personal_board_1 (cost=5.39..42.18 rows=143 width=32) (actual time=0.038..0.087 rows=143 loops=1)

  • Recheck Cond: (account_id = '0b4c3803-a3e6-4a65-8901-3de66db88db2'::uuid)
  • Heap Blocks: exact=30
23. 0.031 0.031 ↓ 1.1 151 1

Bitmap Index Scan on personal_board_account_id_index (cost=0.00..5.35 rows=143 width=0) (actual time=0.031..0.031 rows=151 loops=1)

  • Index Cond: (account_id = '0b4c3803-a3e6-4a65-8901-3de66db88db2'::uuid)
24.          

SubPlan (for Hash Right Join)

25. 0.073 3.431 ↑ 1.0 1 73

Result (cost=246.88..246.89 rows=1 width=32) (actual time=0.047..0.047 rows=1 loops=73)

26.          

Initplan (for Result)

27. 0.073 3.358 ↑ 1.3 3 73

Limit (cost=1.71..246.88 rows=4 width=40) (actual time=0.021..0.046 rows=3 loops=73)

28. 0.111 3.285 ↑ 9.0 3 73

Nested Loop (cost=1.71..1,656.59 rows=27 width=40) (actual time=0.020..0.045 rows=3 loops=73)

29. 0.194 2.190 ↑ 17.3 3 73

Nested Loop (cost=1.28..1,561.69 rows=52 width=16) (actual time=0.017..0.030 rows=3 loops=73)

30. 0.000 0.876 ↑ 196.2 4 73

Nested Loop (cost=0.85..508.40 rows=785 width=16) (actual time=0.011..0.012 rows=4 loops=73)

31. 0.365 0.365 ↑ 30.0 1 73

Index Scan using board_ancestor_ancestor_id_index on board_ancestor (cost=0.42..124.88 rows=30 width=16) (actual time=0.005..0.005 rows=1 loops=73)

  • Index Cond: (ancestor_id = board_page_alias.id)
32. 0.516 0.516 ↑ 36.7 3 86

Index Only Scan using reel_clip_pkey on reel_clip (cost=0.43..11.68 rows=110 width=32) (actual time=0.005..0.006 rows=3 loops=86)

  • Index Cond: (reel_id = board_ancestor.id)
  • Heap Fetches: 7
33. 1.120 1.120 ↑ 1.0 1 280

Index Scan using clip_pkey on clip (cost=0.43..1.33 rows=1 width=32) (actual time=0.004..0.004 rows=1 loops=280)

  • Index Cond: (id = reel_clip.clip_id)
  • Filter: (visible AND (NOT inactive) AND (status <> 'created'::text) AND (status = 'transcoded'::text) AND (workspace_id = '1f32d99e-2062-43cb-b9a8-7ae13ab7c977'::uuid))
  • Rows Removed by Filter: 0
34. 0.984 0.984 ↑ 1.0 1 246

Index Scan using clip_media_pkey on clip_media (cost=0.43..1.81 rows=1 width=56) (actual time=0.004..0.004 rows=1 loops=246)

  • Index Cond: (id = clip.media_id)
  • Filter: (image IS NOT NULL)