explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ENw4

Settings
# exclusive inclusive rows x rows loops node
1. 13.288 79.629 ↓ 43.0 43 1

Nested Loop (cost=5.55..43.28 rows=1 width=18) (actual time=5.569..79.629 rows=43 loops=1)

2. 17.527 29.243 ↓ 202.7 12,366 1

Nested Loop (cost=5.26..16.63 rows=61 width=18) (actual time=0.078..29.243 rows=12,366 loops=1)

3. 0.176 0.400 ↑ 1.0 1 1

Hash Join (cost=4.98..10.24 rows=1 width=8) (actual time=0.064..0.400 rows=1 loops=1)

  • Hash Cond: (s.country_id = ct.id)
4. 0.180 0.180 ↑ 1.0 237 1

Seq Scan on state s (cost=0.00..4.37 rows=237 width=16) (actual time=0.008..0.180 rows=237 loops=1)

  • Filter: active
5. 0.004 0.044 ↑ 1.0 1 1

Hash (cost=4.96..4.96 rows=1 width=8) (actual time=0.044..0.044 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.040 0.040 ↑ 1.0 1 1

Seq Scan on country ct (cost=0.00..4.96 rows=1 width=8) (actual time=0.009..0.040 rows=1 loops=1)

  • Filter: (active AND ((code)::text = 'DE'::text))
  • Rows Removed by Filter: 236
7. 11.316 11.316 ↓ 89.6 12,366 1

Index Scan using idx_city_state_id on city c (cost=0.29..5.00 rows=138 width=26) (actual time=0.010..11.316 rows=12,366 loops=1)

  • Index Cond: (state_id = s.id)
  • Filter: active
8. 37.098 37.098 ↓ 0.0 0 12,366

Index Scan using idx_city_post_code_city_id on city_post_code cpc (cost=0.29..0.43 rows=1 width=8) (actual time=0.003..0.003 rows=0 loops=12,366)

  • Index Cond: (city_id = c.id)
  • Filter: (active AND ((post_code)::text = '54636'::text))
  • Rows Removed by Filter: 3
Planning time : 0.904 ms
Execution time : 79.742 ms