explain.depesz.com

PostgreSQL's explain analyze made readable

Result: shjh

Settings
# exclusive inclusive rows x rows loops node
1. 0.081 17.161 ↑ 1.8 73 1

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

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

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

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

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

  • Group Key: personal_board.board_id
4. 0.008 1.007 ↑ 358.0 1 1

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

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

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

6. 0.045 0.991 ↑ 358.0 1 1

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

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

Bitmap Heap Scan on workspace_member (cost=4.40..50.48 rows=14 width=16) (actual time=0.022..0.039 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.015 0.015 ↑ 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.015..0.015 rows=15 loops=1)

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

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

  • Buckets: 8,192 Batches: 1 Memory Usage: 337kB
10. 0.338 0.338 ↓ 1.0 4,365 1

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

11. 0.007 0.007 ↑ 1.0 1 1

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

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 18kB
13. 0.013 12.685 ↑ 1.0 73 1

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

14. 0.004 12.672 ↑ 1.0 73 1

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

15. 3.396 12.668 ↑ 199.4 73 1

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

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

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

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

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

  • Recheck Cond: (workspace_id = '1f32d99e-2062-43cb-b9a8-7ae13ab7c977'::uuid)
  • Heap Blocks: exact=1,909
18. 1.842 1.842 ↑ 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.842..1.842 rows=13,454 loops=1)

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

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
20. 0.016 0.160 ↓ 1.0 143 1

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

21. 0.065 0.144 ↓ 1.0 143 1

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

  • Group Key: personal_board_1.board_id
22. 0.050 0.079 ↑ 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.034..0.079 rows=143 loops=1)

  • Recheck Cond: (account_id = '0b4c3803-a3e6-4a65-8901-3de66db88db2'::uuid)
  • Heap Blocks: exact=30
23. 0.029 0.029 ↓ 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.029..0.029 rows=151 loops=1)

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

SubPlan (for Hash Right Join)

25. 0.073 3.285 ↑ 1.0 1 73

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

26.          

Initplan (for Result)

27. 0.073 3.212 ↑ 1.3 3 73

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

28. 0.111 3.139 ↑ 9.0 3 73

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

29. 0.121 2.044 ↑ 17.3 3 73

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

30. 0.081 0.803 ↑ 196.2 4 73

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

31. 0.292 0.292 ↑ 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.004..0.004 rows=1 loops=73)

  • Index Cond: (ancestor_id = board_page_alias.id)
32. 0.430 0.430 ↑ 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.004..0.005 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)