explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kGwd : Old tag medium

Settings
# exclusive inclusive rows x rows loops node
1. 1.583 229.214 ↑ 4.0 72 1

GroupAggregate (cost=48,374.78..48,401.85 rows=285 width=610) (actual time=227.640..229.214 rows=72 loops=1)

  • Group Key: clip.created_at, clip.id, clip.account_id, clip.workspace_id, clip.width, clip.height, clip.size, clip.ext, clip.type, clip.duration, clip.rotation, clip.audio, clip.remote, clip.status, clip.recorded_at, clip.updated_at, clip.digitized, clip.hash, clip.synced, clip.description, clip.source, clip.imported_name, clip_media.playback, clip_media.preview, clip_media.seek, clip_media.image, account.first_name, account.last_name, clip_bookmark.clip_id
2. 1.600 227.631 ↓ 1.4 385 1

Sort (cost=48,374.78..48,375.49 rows=285 width=585) (actual time=227.582..227.631 rows=385 loops=1)

  • Sort Key: clip.created_at DESC, clip.id DESC, clip.account_id, clip.workspace_id, clip.width, clip.height, clip.size, clip.ext, clip.type, clip.duration, clip.rotation, clip.audio, clip.remote, clip.status, clip.recorded_at, clip.updated_at, clip.digitized, clip.hash, clip.synced, clip.description, clip.source, clip.imported_name, clip_media.playback, clip_media.preview, clip_media.seek, clip_media.image, account.first_name, account.last_name, clip_bookmark.clip_id
  • Sort Method: quicksort Memory: 223kB
3. 0.066 226.031 ↓ 1.4 385 1

Nested Loop Left Join (cost=46,764.85..48,363.16 rows=285 width=585) (actual time=223.428..226.031 rows=385 loops=1)

4. 0.033 224.957 ↓ 1.3 72 1

Hash Left Join (cost=46,764.13..47,476.12 rows=55 width=545) (actual time=223.409..224.957 rows=72 loops=1)

  • Hash Cond: (clip.id = clip_bookmark.clip_id)
5. 0.061 224.701 ↓ 1.3 72 1

Nested Loop (cost=46,714.13..47,425.76 rows=55 width=529) (actual time=223.177..224.701 rows=72 loops=1)

6. 0.467 224.424 ↓ 1.3 72 1

Hash Join (cost=46,713.70..46,960.88 rows=55 width=355) (actual time=223.165..224.424 rows=72 loops=1)

  • Hash Cond: (account.id = clip.account_id)
7. 0.875 0.875 ↓ 1.1 6,112 1

Seq Scan on account (cost=0.00..225.18 rows=5,718 width=29) (actual time=0.004..0.875 rows=6,112 loops=1)

8. 0.015 223.082 ↓ 1.3 72 1

Hash (cost=46,713.02..46,713.02 rows=55 width=342) (actual time=223.082..223.082 rows=72 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
9. 0.006 223.067 ↓ 1.3 72 1

Limit (cost=46,712.33..46,712.47 rows=55 width=342) (actual time=223.050..223.067 rows=72 loops=1)

10. 0.988 223.061 ↓ 1.3 72 1

Sort (cost=46,712.33..46,712.47 rows=55 width=342) (actual time=223.049..223.061 rows=72 loops=1)

  • Sort Key: clip.created_at DESC, clip.id DESC
  • Sort Method: top-N heapsort Memory: 44kB
11. 1.438 222.073 ↓ 35.1 1,933 1

GroupAggregate (cost=46,709.64..46,710.74 rows=55 width=342) (actual time=220.457..222.073 rows=1,933 loops=1)

  • Group Key: clip.id
  • Filter: (array_length(array_agg(tag_1.id), 1) = 1)
12. 1.638 220.635 ↓ 35.1 1,933 1

Sort (cost=46,709.64..46,709.78 rows=55 width=358) (actual time=220.433..220.635 rows=1,933 loops=1)

  • Sort Key: clip.id DESC
  • Sort Method: quicksort Memory: 566kB
13. 0.331 218.997 ↓ 35.1 1,933 1

Nested Loop (cost=0.71..46,708.05 rows=55 width=358) (actual time=8.446..218.997 rows=1,933 loops=1)

14. 0.008 0.008 ↑ 1.0 1 1

Index Only Scan using tag_pkey on tag tag_1 (cost=0.29..4.31 rows=1 width=16) (actual time=0.006..0.008 rows=1 loops=1)

  • Index Cond: (id = 'd86b5216-7f3f-4db5-81f6-4ae37ecd0838'::uuid)
  • Heap Fetches: 0
15. 1.051 218.658 ↓ 35.1 1,933 1

Nested Loop (cost=0.42..46,703.19 rows=55 width=358) (actual time=8.438..218.658 rows=1,933 loops=1)

16. 211.805 211.805 ↓ 12.2 1,934 1

Seq Scan on clip_tag clip_tag_1 (cost=0.00..45,370.45 rows=159 width=32) (actual time=8.423..211.805 rows=1,934 loops=1)

  • Filter: (tag_id = 'd86b5216-7f3f-4db5-81f6-4ae37ecd0838'::uuid)
  • Rows Removed by Filter: 2338424
17. 5.802 5.802 ↑ 1.0 1 1,934

Index Scan using clip_pkey on clip (cost=0.42..8.37 rows=1 width=342) (actual time=0.003..0.003 rows=1 loops=1,934)

  • Index Cond: (id = clip_tag_1.clip_id)
  • Filter: (visible AND (NOT inactive) AND (status <> 'created'::text) AND (workspace_id = '8271b633-a524-46e8-9620-c2d15c7ce3c6'::uuid))
  • Rows Removed by Filter: 0
18. 0.216 0.216 ↑ 1.0 1 72

Index Scan using clip_media_pkey on clip_media (cost=0.42..8.44 rows=1 width=206) (actual time=0.003..0.003 rows=1 loops=72)

  • Index Cond: (id = clip.media_id)
19. 0.000 0.223 ↓ 0.0 0 1

Hash (cost=49.96..49.96 rows=3 width=16) (actual time=0.223..0.223 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
20. 0.223 0.223 ↓ 0.0 0 1

Seq Scan on clip_bookmark (cost=0.00..49.96 rows=3 width=16) (actual time=0.223..0.223 rows=0 loops=1)

  • Filter: (account_id = '505e48ea-de53-46a3-9d43-b974ecdedafd'::uuid)
  • Rows Removed by Filter: 2477
21. 0.335 1.008 ↑ 1.0 5 72

Nested Loop Left Join (cost=0.72..16.08 rows=5 width=56) (actual time=0.005..0.014 rows=5 loops=72)

22. 0.288 0.288 ↑ 1.0 5 72

Index Only Scan using clip_tag_clip_id_tag_id_key on clip_tag (cost=0.43..14.48 rows=5 width=32) (actual time=0.004..0.004 rows=5 loops=72)

  • Index Cond: (clip_id = clip.id)
  • Heap Fetches: 385
23. 0.385 0.385 ↑ 1.0 1 385

Index Scan using tag_pkey on tag (cost=0.29..0.31 rows=1 width=40) (actual time=0.001..0.001 rows=1 loops=385)

  • Index Cond: (id = clip_tag.tag_id)
Planning time : 1.403 ms