explain.depesz.com

PostgreSQL's explain analyze made readable

Result: f3hW

Settings
# exclusive inclusive rows x rows loops node
1. 290.908 3,603.464 ↑ 1.0 321,255 1

Gather (cost=346,670.26..379,983.15 rows=321,255 width=13) (actual time=2,242.361..3,603.464 rows=321,255 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
2. 724.079 3,312.556 ↑ 1.3 80,314 4

Merge Left Join (cost=345,670.26..346,857.65 rows=103,631 width=13) (actual time=2,239.277..3,312.556 rows=80,314 loops=4)

  • Merge Cond: (m.media = ((('{'::text || shv.tag) || '}'::text)))
  • Join Filter: ((m.media ~~ '{%'::text) AND (shv.parent_type = m.parent_type) AND (shv.parent_id = m.parent_id))
  • Rows Removed by Join Filter: 3694013
3. 152.267 2,399.997 ↑ 1.3 80,314 4

Merge Left Join (cost=345,278.81..346,283.71 rows=103,631 width=32) (actual time=2,220.546..2,399.997 rows=80,314 loops=4)

  • Merge Cond: (m.media = ((me.id)::text))
4. 225.727 556.058 ↑ 1.3 80,314 4

Sort (cost=287,802.29..287,854.11 rows=103,631 width=28) (actual time=550.794..556.058 rows=80,314 loops=4)

  • Sort Key: m.media
  • Sort Method: quicksort Memory: 8352kB
5. 294.272 330.331 ↑ 1.3 80,314 4

Nested Loop (cost=0.17..286,075.68 rows=103,631 width=28) (actual time=0.076..330.331 rows=80,314 loops=4)

6. 36.056 36.056 ↑ 1.3 80,314 4

Parallel Index Only Scan using media_messages_migration_message_id_uindex on media_messages_migration mmm (cost=0.08..5,803.93 rows=103,631 width=4) (actual time=0.026..36.056 rows=80,314 loops=4)

  • Heap Fetches: 90309
7. 0.003 0.003 ↑ 1.0 1 321,255

Index Scan using messages_pkey on messages m (cost=0.09..2.70 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=321,255)

  • Index Cond: (id = mmm.message_id)
8. 1,506.478 1,691.672 ↓ 1.1 396,852 4

Sort (cost=57,476.52..57,660.92 rows=368,804 width=8) (actual time=1,669.745..1,691.672 rows=396,852 loops=4)

  • Sort Key: ((me.id)::text)
  • Sort Method: quicksort Memory: 29721kB
9. 185.194 185.194 ↓ 1.0 371,903 4

Seq Scan on media me (cost=0.00..50,656.41 rows=368,804 width=8) (actual time=0.024..185.194 rows=371,903 loops=4)

10. 185.112 188.480 ↓ 307.5 3,704,179 4

Sort (cost=391.45..397.48 rows=12,047 width=31) (actual time=18.721..188.480 rows=3,704,179 loops=4)

  • Sort Key: ((('{'::text || shv.tag) || '}'::text))
  • Sort Method: quicksort Memory: 1499kB
11. 3.368 3.368 ↓ 1.0 12,125 4

Seq Scan on social_helper_videos shv (cost=0.00..228.14 rows=12,047 width=31) (actual time=0.026..3.368 rows=12,125 loops=4)