explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yb1n

Settings
# exclusive inclusive rows x rows loops node
1. 1.409 1,807.534 ↑ 5.2 72 1

GroupAggregate (cost=286,141.77..286,177.30 rows=374 width=610) (actual time=1,806.145..1,807.534 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.264 1,806.125 ↑ 1.1 346 1

Sort (cost=286,141.77..286,142.70 rows=374 width=585) (actual time=1,806.092..1,806.125 rows=346 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: 203kB
3. 0.087 1,804.861 ↑ 1.1 346 1

Nested Loop Left Join (cost=284,110.72..286,125.78 rows=374 width=585) (actual time=1,802.208..1,804.861 rows=346 loops=1)

4. 0.022 1,803.766 ↑ 1.0 72 1

Hash Left Join (cost=284,110.00..284,965.95 rows=72 width=545) (actual time=1,802.188..1,803.766 rows=72 loops=1)

  • Hash Cond: (clip.id = clip_bookmark.clip_id)
5. 0.008 1,803.518 ↑ 1.0 72 1

Nested Loop (cost=284,060.00..284,915.49 rows=72 width=529) (actual time=1,801.954..1,803.518 rows=72 loops=1)

6. 0.497 1,803.222 ↑ 1.0 72 1

Hash Join (cost=284,059.57..284,306.91 rows=72 width=355) (actual time=1,801.941..1,803.222 rows=72 loops=1)

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

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

8. 0.017 1,801.854 ↑ 1.0 72 1

Hash (cost=284,058.67..284,058.67 rows=72 width=342) (actual time=1,801.854..1,801.854 rows=72 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 25kB
9. 0.008 1,801.837 ↑ 1.0 72 1

Limit (cost=284,057.77..284,057.95 rows=72 width=342) (actual time=1,801.816..1,801.837 rows=72 loops=1)

10. 51.782 1,801.829 ↑ 373.5 72 1

Sort (cost=284,057.77..284,125.00 rows=26,891 width=342) (actual time=1,801.816..1,801.829 rows=72 loops=1)

  • Sort Key: clip.created_at DESC, clip.id DESC
  • Sort Method: top-N heapsort Memory: 44kB
11. 76.564 1,750.047 ↓ 4.4 118,236 1

Group (cost=254,928.66..283,093.74 rows=26,891 width=342) (actual time=1,294.437..1,750.047 rows=118,236 loops=1)

  • Group Key: clip.id
12. 99.516 1,673.483 ↓ 4.4 118,236 1

Merge Join (cost=254,928.66..283,026.51 rows=26,891 width=342) (actual time=1,294.433..1,673.483 rows=118,236 loops=1)

  • Merge Cond: (clip_tag_1.clip_id = clip_1.id)
13. 204.542 1,051.131 ↓ 2.8 150,446 1

Sort (cost=179,582.89..179,717.35 rows=53,783 width=358) (actual time=987.912..1,051.131 rows=150,446 loops=1)

  • Sort Key: clip.id DESC
  • Sort Method: external merge Disk: 34192kB
14. 158.406 846.589 ↓ 2.8 150,446 1

Hash Join (cost=108,525.58..166,529.93 rows=53,783 width=358) (actual time=475.003..846.589 rows=150,446 loops=1)

  • Hash Cond: (clip_tag_1.clip_id = clip.id)
15. 222.413 222.413 ↓ 1.0 157,514 1

Seq Scan on clip_tag clip_tag_1 (cost=0.00..45,370.45 rows=154,418 width=16) (actual time=7.441..222.413 rows=157,514 loops=1)

  • Filter: (tag_id = '106b95a6-53ea-4591-8c33-1e2e227cedca'::uuid)
  • Rows Removed by Filter: 2182850
16. 157.012 465.770 ↓ 1.1 244,947 1

Hash (cost=95,731.53..95,731.53 rows=222,804 width=342) (actual time=465.770..465.770 rows=244,947 loops=1)

  • Buckets: 16384 Batches: 32 Memory Usage: 1937kB
17. 308.758 308.758 ↓ 1.1 244,947 1

Seq Scan on clip (cost=0.00..95,731.53 rows=222,804 width=342) (actual time=0.091..308.758 rows=244,947 loops=1)

  • Filter: (visible AND (NOT inactive) AND (status <> 'created'::text) AND (workspace_id = '8271b633-a524-46e8-9620-c2d15c7ce3c6'::uuid))
  • Rows Removed by Filter: 383222
18. 225.970 522.836 ↓ 1.9 595,778 1

Index Only Scan Backward using clip_pkey on clip clip_1 (cost=75,206.60..102,245.34 rows=319,851 width=16) (actual time=306.513..522.836 rows=595,778 loops=1)

  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 32391
  • Heap Fetches: 7874
19.          

SubPlan (forIndex Only Scan Backward)

20. 11.750 296.866 ↓ 1.1 32,391 1

Nested Loop (cost=0.42..75,129.19 rows=30,795 width=16) (actual time=13.132..296.866 rows=32,391 loops=1)

21. 220.334 220.334 ↓ 1.1 32,391 1

Seq Scan on clip_tag clip_tag_2 (cost=0.00..45,370.45 rows=30,795 width=16) (actual time=13.117..220.334 rows=32,391 loops=1)

  • Filter: (tag_id = 'a393f6a5-0adc-4d6e-b2ef-f90235dffc0b'::uuid)
  • Rows Removed by Filter: 2307973
22. 64.782 64.782 ↑ 1.0 1 32,391

Index Only Scan using clip_pkey on clip clip_2 (cost=0.42..0.96 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=32,391)

  • Index Cond: (id = clip_tag_2.clip_id)
  • Heap Fetches: 52
23. 0.288 0.288 ↑ 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.004..0.004 rows=1 loops=72)

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

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
25. 0.226 0.226 ↓ 0.0 0 1

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

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

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

27. 0.360 0.360 ↑ 1.0 5 72

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

  • Index Cond: (clip_id = clip.id)
  • Heap Fetches: 346
28. 0.692 0.692 ↑ 1.0 1 346

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

  • Index Cond: (id = clip_tag.tag_id)