explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mqg9S

Settings
# exclusive inclusive rows x rows loops node
1. 0.014 1,534.125 ↑ 1.0 45 1

Limit (cost=544,789.22..544,789.34 rows=45 width=304) (actual time=1,534.115..1,534.125 rows=45 loops=1)

2. 1.894 1,534.111 ↑ 5.5 315 1

Sort (cost=544,788.55..544,792.90 rows=1,742 width=304) (actual time=1,534.082..1,534.111 rows=315 loops=1)

  • Sort Key: ((teaser.created_at <=> '1'::bigint)) DESC
  • Sort Method: top-N heapsort Memory: 343kB
3. 5.527 1,532.217 ↓ 1.1 1,969 1

Nested Loop (cost=125,623.03..544,707.55 rows=1,742 width=304) (actual time=104.479..1,532.217 rows=1,969 loops=1)

  • Join Filter: (teaser.id = teaser_country_relation.teaser_id)
4. 603.250 1,459.466 ↓ 1.1 11,204 1

Hash Join (cost=125,622.47..312,007.53 rows=10,546 width=304) (actual time=85.788..1,459.466 rows=11,204 loops=1)

  • Hash Cond: (teaser_network_relation.teaser_id = teaser.id)
5. 776.556 776.556 ↓ 1.0 3,692,410 1

Seq Scan on teaser_network_relation (cost=0.00..176,836.06 rows=3,637,714 width=8) (actual time=0.019..776.556 rows=3,692,410 loops=1)

  • Filter: (network_id = '4'::bigint)
  • Rows Removed by Filter: 5679174
6. 11.028 79.660 ↓ 1.4 48,929 1

Hash (cost=125,188.90..125,188.90 rows=34,685 width=296) (actual time=79.659..79.660 rows=48,929 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 16115kB
7. 54.707 68.632 ↓ 1.4 48,929 1

Bitmap Heap Scan on teaser (cost=345.14..125,188.90 rows=34,685 width=296) (actual time=21.422..68.632 rows=48,929 loops=1)

  • Recheck Cond: (teaser_tls @@ plainto_tsquery('Surprising'::text))
  • Filter: ((clicks >= '0'::bigint) AND (clicks <= '4000000'::bigint))
  • Rows Removed by Filter: 4
  • Heap Blocks: exact=44950
8. 13.925 13.925 ↓ 1.4 48,933 1

Bitmap Index Scan on teaser_rum_created_at (cost=0.00..336.46 rows=34,695 width=0) (actual time=13.925..13.925 rows=48,933 loops=1)

  • Index Cond: (teaser_tls @@ plainto_tsquery('Surprising'::text))
9. 67.224 67.224 ↓ 0.0 0 11,204

Index Only Scan using idx_16500_idx_teaser_country_relation_temp_teaser_id_country_id on teaser_country_relation (cost=0.57..21.96 rows=8 width=8) (actual time=0.006..0.006 rows=0 loops=11,204)

  • Index Cond: ((teaser_id = teaser_network_relation.teaser_id) AND (country_id = ANY ('{3,67,115}'::bigint[])))
  • Heap Fetches: 1969