explain.depesz.com

PostgreSQL's explain analyze made readable

Result: tXBQ

Settings
# exclusive inclusive rows x rows loops node
1. 127.332 5,628.646 ↓ 41.0 321,255 1

Sort (cost=3,539,230.10..3,539,234.02 rows=7,827 width=13) (actual time=5,598.408..5,628.646 rows=321,255 loops=1)

  • Sort Key: m.id DESC
  • Sort Method: quicksort Memory: 27347kB
2. 98.874 5,501.314 ↓ 41.0 321,255 1

Gather (cost=3,537,313.91..3,539,128.87 rows=7,827 width=13) (actual time=5,147.320..5,501.314 rows=321,255 loops=1)

  • Workers Planned: 4
  • Workers Launched: 4
3. 74.678 5,402.440 ↓ 32.8 64,251 5

Nested Loop Left Join (cost=3,536,313.91..3,537,346.17 rows=1,957 width=13) (actual time=5,136.857..5,402.440 rows=64,251 loops=5)

4. 159.643 5,327.761 ↓ 32.8 64,251 5

Merge Left Join (cost=3,536,313.85..3,537,056.51 rows=1,957 width=32) (actual time=5,136.817..5,327.761 rows=64,251 loops=5)

  • Merge Cond: (m.media = ((me.id)::text))
5. 207.188 3,482.378 ↓ 32.8 64,251 5

Sort (cost=3,478,837.33..3,478,838.31 rows=1,957 width=28) (actual time=3,475.042..3,482.378 rows=64,251 loops=5)

  • Sort Key: m.media
  • Sort Method: quicksort Memory: 5324kB
6. 3,275.190 3,275.190 ↓ 32.8 64,251 5

Parallel Seq Scan on messages m (cost=0.00..3,478,815.93 rows=1,957 width=28) (actual time=0.161..3,275.190 rows=64,251 loops=5)

  • Filter: ((media IS NOT NULL) AND (type = 'video'::text))
  • Rows Removed by Filter: 3575169
7. 1,505.785 1,685.740 ↓ 1.0 382,024 5

Sort (cost=57,476.52..57,660.92 rows=368,804 width=8) (actual time=1,661.769..1,685.740 rows=382,024 loops=5)

  • Sort Key: ((me.id)::text)
  • Sort Method: quicksort Memory: 29721kB
8. 179.955 179.955 ↓ 1.0 371,903 5

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

9. 0.001 0.001 ↓ 0.0 0 321,255

Index Scan using social_helper_videos_index_parent_type_parent_id_tag on social_helper_videos shv (cost=0.06..0.15 rows=1 width=31) (actual time=0.001..0.001 rows=0 loops=321,255)

  • Index Cond: ((parent_type = m.parent_type) AND (parent_id = m.parent_id))
  • Filter: ((('{'::text || tag) || '}'::text) = m.media)
  • Rows Removed by Filter: 0