explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g159

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 11,899.040 ↑ 1.0 45 1

Limit (cost=393,879.92..393,880.04 rows=45 width=302) (actual time=11,899.026..11,899.040 rows=45 loops=1)

2. 8.022 11,899.030 ↑ 16.8 45 1

Sort (cost=393,879.92..393,881.82 rows=758 width=302) (actual time=11,899.024..11,899.030 rows=45 loops=1)

  • Sort Key: ((teaser.created_at <=> '0'::bigint)) DESC
  • Sort Method: top-N heapsort Memory: 66kB
3. 72.430 11,891.008 ↓ 7.6 5,745 1

Nested Loop (cost=204,269.01..393,855.32 rows=758 width=302) (actual time=6,594.921..11,891.008 rows=5,745 loops=1)

  • Join Filter: (teaser.id = teaser_country_relation.teaser_id)
4. 565.668 7,465.110 ↓ 3.3 51,827 1

Hash Join (cost=204,268.44..298,624.95 rows=15,569 width=302) (actual time=6,541.729..7,465.110 rows=51,827 loops=1)

  • Hash Cond: (teaser_network_relation.teaser_id = teaser.id)
5. 368.720 470.239 ↓ 1.0 2,303,264 1

Bitmap Heap Scan on teaser_network_relation (cost=28,964.85..117,305.20 rows=2,291,868 width=8) (actual time=112.325..470.239 rows=2,303,264 loops=1)

  • Recheck Cond: (network_id = ANY ('{26,6}'::bigint[]))
  • Heap Blocks: exact=59596
6. 101.519 101.519 ↓ 1.0 2,303,264 1

Bitmap Index Scan on idx_16506_fk_teaser_network_relation_network_id (cost=0.00..28,391.88 rows=2,291,868 width=0) (actual time=101.518..101.519 rows=2,303,264 loops=1)

  • Index Cond: (network_id = ANY ('{26,6}'::bigint[]))
7. 46.792 6,429.203 ↓ 1.1 86,006 1

Hash (cost=174,289.43..174,289.43 rows=81,133 width=294) (actual time=6,429.203..6,429.203 rows=86,006 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 26182kB
8. 6,360.725 6,382.411 ↓ 1.1 86,006 1

Bitmap Heap Scan on teaser (cost=699.64..174,289.43 rows=81,133 width=294) (actual time=34.319..6,382.411 rows=86,006 loops=1)

  • Recheck Cond: (to_tsvector('russian'::regconfig, (title)::text) @@ plainto_tsquery('food'::text))
  • Filter: ((clicks >= '0'::bigint) AND (clicks <= '4000000'::bigint))
  • Rows Removed by Filter: 6
  • Heap Blocks: exact=65904
9. 21.686 21.686 ↓ 1.1 86,012 1

Bitmap Index Scan on teaser_tls (cost=0.00..679.36 rows=81,215 width=0) (actual time=21.686..21.686 rows=86,012 loops=1)

  • Index Cond: (to_tsvector('russian'::regconfig, (title)::text) @@ plainto_tsquery('food'::text))
10. 4,353.468 4,353.468 ↓ 0.0 0 51,827

Index Only Scan using idx_16500_idx_teaser_country_relation_temp_teaser_id_country_id on teaser_country_relation (cost=0.57..6.09 rows=2 width=8) (actual time=0.084..0.084 rows=0 loops=51,827)

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