explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TSiJ

Settings
# exclusive inclusive rows x rows loops node
1. 1.419 1,460.241 ↑ 5.2 72 1

GroupAggregate (cost=211,440.14..211,475.67 rows=374 width=610) (actual time=1,458.839..1,460.241 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.318 1,458.822 ↑ 1.1 346 1

Sort (cost=211,440.14..211,441.07 rows=374 width=585) (actual time=1,458.782..1,458.822 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.091 1,457.504 ↑ 1.1 346 1

Nested Loop Left Join (cost=209,409.09..211,424.16 rows=374 width=585) (actual time=1,454.866..1,457.504 rows=346 loops=1)

4. 0.028 1,456.405 ↑ 1.0 72 1

Hash Left Join (cost=209,408.37..210,264.32 rows=72 width=545) (actual time=1,454.844..1,456.405 rows=72 loops=1)

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

Nested Loop (cost=209,358.37..210,213.86 rows=72 width=529) (actual time=1,454.588..1,456.130 rows=72 loops=1)

6. 0.496 1,455.842 ↑ 1.0 72 1

Hash Join (cost=209,357.94..209,605.28 rows=72 width=355) (actual time=1,454.574..1,455.842 rows=72 loops=1)

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

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

8. 0.018 1,454.483 ↑ 1.0 72 1

Hash (cost=209,357.04..209,357.04 rows=72 width=342) (actual time=1,454.483..1,454.483 rows=72 loops=1)

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

Limit (cost=209,356.14..209,356.32 rows=72 width=342) (actual time=1,454.448..1,454.465 rows=72 loops=1)

10. 65.187 1,454.460 ↑ 747.0 72 1

Sort (cost=209,356.14..209,490.60 rows=53,783 width=342) (actual time=1,454.447..1,454.460 rows=72 loops=1)

  • Sort Key: clip.created_at DESC, clip.id DESC
  • Sort Method: top-N heapsort Memory: 44kB
11. 96.768 1,389.273 ↓ 2.8 150,446 1

Group (cost=179,718.53..207,428.04 rows=53,783 width=342) (actual time=1,003.373..1,389.273 rows=150,446 loops=1)

  • Group Key: clip.id
12. 107.536 1,292.505 ↓ 2.8 150,446 1

Merge Join (cost=179,718.53..207,293.58 rows=53,783 width=342) (actual time=1,003.370..1,292.505 rows=150,446 loops=1)

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

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

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

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

  • Hash Cond: (clip_tag_1.clip_id = clip.id)
15. 240.791 240.791 ↓ 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.465..240.791 rows=157,514 loops=1)

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

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

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

Seq Scan on clip (cost=0.00..95,731.53 rows=222,804 width=342) (actual time=0.101..310.538 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. 121.552 121.552 ↑ 1.0 628,169 1

Index Only Scan Backward using clip_pkey on clip clip_1 (cost=0.42..25,439.91 rows=639,702 width=16) (actual time=0.016..121.552 rows=628,169 loops=1)

  • Heap Fetches: 7874
19. 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.003..0.004 rows=1 loops=72)

  • Index Cond: (id = clip.media_id)
20. 0.002 0.247 ↓ 0.0 0 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
21. 0.245 0.245 ↓ 0.0 0 1

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

  • Filter: (account_id = '505e48ea-de53-46a3-9d43-b974ecdedafd'::uuid)
  • Rows Removed by Filter: 2477
22. 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)

23. 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
24. 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)