explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XNKc

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2.817 18.870 ↓ 751.0 751 1

Nested Loop (cost=368.14..430.41 rows=1 width=158) (actual time=15.263..18.870 rows=751 loops=1)

  • -> Index Scan using city_pkey on city c (cost=0.29..7.75 rows=1 width=28) (actual time=0.003..0.003 rows=1 loops=751) Index Cond: (id = p.city_id)”
2. 0.664 16.053 ↓ 751.0 751 1

Hash Right Join (cost=367.85..422.66 rows=1 width=138) (actual time=15.242..16.053 rows=751 loops=1)

  • Hash Cond: (pr.program_id = p.id)
  • Filter: ((zip_code)::text = ANY (‘{92360,93000,93140,93190,93420,93410,93320,93150,93700}’::text[]))
3. 0.295 0.295 ↑ 1.0 1,656 1

Seq Scan on program_document pr (cost=0.00..48.56 rows=1,656 width=62) (actual time=0.012..0.295 rows=1,656 loops=1)

4. 0.178 15.094 ↓ 147.0 147 1

Hash (cost=367.83..367.83 rows=1 width=84) (actual time=15.094..15.094 rows=147 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 28kB
5. 1.606 14.916 ↓ 147.0 147 1

Nested Loop (cost=1.28..367.83 rows=1 width=84) (actual time=1.677..14.916 rows=147 loops=1)

6. 1.057 5.777 ↓ 1,255.5 2,511 1

Hash Left Join (cost=1.01..366.90 rows=2 width=35) (actual time=0.055..5.777 rows=2,511 loops=1)

  • Hash Cond: (r.id = rr.realty_id)
  • Filter: ((rr.realty_id IS NULL) OR (rr.record_id = ‘-41’::integer))
  • Rows Removed by Filter: 7
7. 4.702 4.702 ↓ 1.0 2,517 1

Seq Scan on realty r (cost=0.00..356.65 rows=2,462 width=43) (actual time=0.022..4.702 rows=2,517 loops=1)

  • Filter: (((availability)::text <> ‘OPTION’::text) AND ((availability)::text <> ‘SOLD’::text) AND (including_taxes_price <= ‘312668’::double precision) AND (((type)::text = ‘HOUSE’::text) OR ((type)::text = ‘APARTMENT’::text) OR ((type)::text = ‘DUPLEX’::text) OR ((type)::text = ‘TRIPLEX’::text)))
  • Rows Removed by Filter: 2,452
8. 0.007 0.018 ↓ 10.0 10 1

Hash (cost=1.00..1.00 rows=1 width=16) (actual time=0.018..0.018 rows=10 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 0.011 0.011 ↓ 10.0 10 1

Seq Scan on record_realty rr (cost=0.00..1.00 rows=1 width=16) (actual time=0.008..0.011 rows=10 loops=1)

10. 7.533 7.533 ↓ 0.0 0 2,511

Index Scan using program_pkey on program p (cost=0.27..0.45 rows=1 width=57) (actual time=0.003..0.003 rows=0 loops=2,511)

  • Index Cond: (id = r.program_id)
  • Filter: ((is_eligible_pinel IS TRUE) AND ((department_id)::text = ANY (‘{92,93}‘::text[])))
  • Rows Removed by Filter: 1