explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CwVBk : New tag medium

Settings
# exclusive inclusive rows x rows loops node
1. 1.605 362.307 ↑ 4.0 72 1

GroupAggregate (cost=47,900.65..47,927.73 rows=285 width=610) (actual time=360.728..362.307 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.859 360.702 ↓ 1.4 385 1

Sort (cost=47,900.65..47,901.36 rows=285 width=585) (actual time=360.659..360.702 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.162 358.843 ↓ 1.4 385 1

Nested Loop Left Join (cost=46,290.73..47,889.03 rows=285 width=585) (actual time=235.778..358.843 rows=385 loops=1)

4. 0.067 237.073 ↓ 1.3 72 1

Hash Left Join (cost=46,290.01..47,001.99 rows=55 width=545) (actual time=233.683..237.073 rows=72 loops=1)

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

Nested Loop (cost=46,240.01..46,951.64 rows=55 width=529) (actual time=233.174..236.509 rows=72 loops=1)

6. 0.590 234.537 ↓ 1.3 72 1

Hash Join (cost=46,239.58..46,486.75 rows=55 width=355) (actual time=233.158..234.537 rows=72 loops=1)

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

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

8. 0.024 233.008 ↓ 1.3 72 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
9. 0.013 232.984 ↓ 1.3 72 1

Limit (cost=46,238.21..46,238.34 rows=55 width=342) (actual time=232.961..232.984 rows=72 loops=1)

10. 1.823 232.971 ↓ 1.3 72 1

Sort (cost=46,238.21..46,238.34 rows=55 width=342) (actual time=232.960..232.971 rows=72 loops=1)

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

Group (cost=46,236.34..46,236.62 rows=55 width=342) (actual time=229.503..231.148 rows=1,933 loops=1)

  • Group Key: clip.id
12. 2.063 229.846 ↓ 35.1 1,933 1

Sort (cost=46,236.34..46,236.48 rows=55 width=342) (actual time=229.500..229.846 rows=1,933 loops=1)

  • Sort Key: clip.id DESC
  • Sort Method: quicksort Memory: 562kB
13. 0.193 227.783 ↓ 35.1 1,933 1

Nested Loop (cost=0.85..46,234.75 rows=55 width=342) (actual time=8.455..227.783 rows=1,933 loops=1)

  • Join Filter: (clip_tag_1.clip_id = clip.id)
14. 0.259 219.854 ↓ 12.2 1,934 1

Nested Loop (cost=0.42..46,070.40 rows=159 width=32) (actual time=8.442..219.854 rows=1,934 loops=1)

15. 213.793 213.793 ↓ 12.2 1,934 1

Seq Scan on clip_tag clip_tag_1 (cost=0.00..45,370.45 rows=159 width=16) (actual time=8.433..213.793 rows=1,934 loops=1)

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

Index Only Scan using clip_pkey on clip clip_1 (cost=0.42..4.39 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=1,934)

  • Index Cond: (id = clip_tag_1.clip_id)
  • Heap Fetches: 2
17. 7.736 7.736 ↑ 1.0 1 1,934

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

  • Index Cond: (id = clip_1.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. 1.944 1.944 ↑ 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.026..0.027 rows=1 loops=72)

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

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

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

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

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

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

22. 110.952 110.952 ↑ 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=1.539..1.541 rows=5 loops=72)

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

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

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