explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BjMH : Events

Settings
# exclusive inclusive rows x rows loops node
1. 0.144 43,228.241 ↑ 100.0 5 1

Limit (cost=1,142.98..1,357.96 rows=500 width=760) (actual time=402.930..43,228.241 rows=5 loops=1)

2. 0.166 43,228.097 ↑ 173,857.2 5 1

Merge Left Join (cost=1,142.98..374,900.27 rows=869,286 width=760) (actual time=402.911..43,228.097 rows=5 loops=1)

  • Merge Cond: (event.id = links.event_id)
3. 18,203.002 42,825.067 ↑ 173,857.2 5 1

Nested Loop (cost=0.71..371,544.03 rows=869,286 width=479) (actual time=0.094..42,825.067 rows=5 loops=1)

4. 11,291.921 11,291.921 ↑ 1.0 833,134 1

Index Scan Backward using event_data_pkey on event_data event (cost=0.43..103,641.85 rows=870,264 width=463) (actual time=0.044..11,291.921 rows=833,134 loops=1)

  • Filter: ((NOT read) AND (NOT irrelevant))
  • Rows Removed by Filter: 448272
5. 13,330.144 13,330.144 ↓ 0.0 0 833,134

Index Scan using sources_pkey on sources source (cost=0.28..0.30 rows=1 width=24) (actual time=0.016..0.016 rows=0 loops=833,134)

  • Index Cond: (id = event.source_id)
  • Filter: ((type)::text <> 'rss-news'::text)
  • Rows Removed by Filter: 1
6. 37.478 402.864 ↑ 691.0 5 1

Sort (cost=1,142.27..1,150.91 rows=3,455 width=129) (actual time=402.783..402.864 rows=5 loops=1)

  • Sort Key: links.event_id DESC
  • Sort Method: quicksort Memory: 1141kB
7. 66.271 365.386 ↑ 1.0 3,455 1

Subquery Scan on links (cost=783.74..939.21 rows=3,455 width=129) (actual time=175.598..365.386 rows=3,455 loops=1)

8. 82.947 299.115 ↑ 1.0 3,455 1

GroupAggregate (cost=783.74..904.66 rows=3,455 width=129) (actual time=175.582..299.115 rows=3,455 loops=1)

  • Group Key: links_1.event_id, published.status, published.article_uuid
9. 72.245 216.168 ↑ 1.0 3,455 1

Sort (cost=783.74..792.38 rows=3,455 width=161) (actual time=175.534..216.168 rows=3,455 loops=1)

  • Sort Key: links_1.event_id, published.status, published.article_uuid
  • Sort Method: quicksort Memory: 1046kB
10. 62.999 143.923 ↑ 1.0 3,455 1

Hash Left Join (cost=239.25..580.68 rows=3,455 width=161) (actual time=47.868..143.923 rows=3,455 loops=1)

  • Hash Cond: ((links_1.url = published.source_url) AND (links_1.content_type = published.content_type) AND (links_1.event_id = published.event_id))
11. 33.106 33.106 ↑ 1.0 3,455 1

Seq Scan on exchange_links links_1 (cost=0.00..302.55 rows=3,455 width=136) (actual time=0.017..33.106 rows=3,455 loops=1)

  • Filter: (content_type IS NOT NULL)
12. 23.827 47.818 ↑ 1.0 2,191 1

Hash (cost=200.91..200.91 rows=2,191 width=157) (actual time=47.808..47.818 rows=2,191 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 448kB
13. 23.991 23.991 ↑ 1.0 2,191 1

Seq Scan on exchange_published published (cost=0.00..200.91 rows=2,191 width=157) (actual time=0.015..23.991 rows=2,191 loops=1)