explain.depesz.com

PostgreSQL's explain analyze made readable

Result: x3C

Settings
# exclusive inclusive rows x rows loops node
1. 0.025 5,646.881 ↑ 56.9 19 1

Sort (cost=580,714.64..580,717.35 rows=1,082 width=680) (actual time=5,646.878..5,646.881 rows=19 loops=1)

  • Sort Key: teaser.created_at DESC
  • Sort Method: quicksort Memory: 30kB
2. 0.089 5,646.856 ↑ 56.9 19 1

Nested Loop (cost=140,730.38..580,660.11 rows=1,082 width=680) (actual time=3,583.994..5,646.856 rows=19 loops=1)

  • Join Filter: (teaser.id = teaser_network_relation.teaser_id)
3. 193.059 5,645.876 ↑ 50.6 81 1

Hash Join (cost=140,729.95..568,209.98 rows=4,101 width=684) (actual time=3,583.962..5,645.876 rows=81 loops=1)

  • Hash Cond: (teaser_country_relation.teaser_id = teaser.id)
4. 5,308.331 5,449.509 ↓ 1.1 877,854 1

Bitmap Heap Scan on teaser_country_relation (cost=17,705.58..432,222.90 rows=820,186 width=4) (actual time=149.171..5,449.509 rows=877,854 loops=1)

  • Recheck Cond: (country_id = ANY ('{3,67}'::integer[]))
  • Rows Removed by Index Recheck: 43178965
  • Heap Blocks: exact=35407 lossy=237647
5. 141.178 141.178 ↓ 1.1 877,854 1

Bitmap Index Scan on "idx-teaser_country_relation-country_id" (cost=0.00..17,500.53 rows=820,186 width=0) (actual time=141.178..141.178 rows=877,854 loops=1)

  • Index Cond: (country_id = ANY ('{3,67}'::integer[]))
6. 0.364 3.308 ↑ 59.8 669 1

Hash (cost=119,086.37..119,086.37 rows=40,000 width=680) (actual time=3.308..3.308 rows=669 loops=1)

  • Buckets: 8192 Batches: 8 Memory Usage: 85kB
7. 2.761 2.944 ↑ 59.8 669 1

Bitmap Heap Scan on teaser (cost=394.25..119,086.37 rows=40,000 width=680) (actual time=0.265..2.944 rows=669 loops=1)

  • Recheck Cond: (to_tsvector('english'::regconfig, (title)::text) @@ plainto_tsquery('bc'::text))
  • Heap Blocks: exact=667
8. 0.183 0.183 ↑ 59.8 669 1

Bitmap Index Scan on search_index (cost=0.00..384.25 rows=40,000 width=0) (actual time=0.183..0.183 rows=669 loops=1)

  • Index Cond: (to_tsvector('english'::regconfig, (title)::text) @@ plainto_tsquery('bc'::text))
9. 0.891 0.891 ↓ 0.0 0 81

Index Scan using "idx-teaser_network_relation-teaser_id" on teaser_network_relation (cost=0.43..3.02 rows=1 width=4) (actual time=0.011..0.011 rows=0 loops=81)

  • Index Cond: (teaser_id = teaser_country_relation.teaser_id)
  • Filter: (network_id = ANY ('{13,3}'::integer[]))
  • Rows Removed by Filter: 2