explain.depesz.com

PostgreSQL's explain analyze made readable

Result: EeKP

Settings
# exclusive inclusive rows x rows loops node
1. 401.179 15,078.407 ↓ 4,931.0 4,931 1

Nested Loop Left Join (cost=53.62..236.70 rows=1 width=237) (actual time=11.205..15,078.407 rows=4,931 loops=1)

  • Join Filter: ((lss.cid = lsw.cid) AND (lss.id = lsw.lease_start_structure_id))
  • Filter: ((pcs.lease_term_structure_id = lt.lease_term_structure_id) OR (lsw.lease_term_id = lt.id))
  • Rows Removed by Filter: 352352
2. 3,386.839 14,319.945 ↓ 357,283.0 357,283 1

Nested Loop (cost=53.34..235.44 rows=1 width=261) (actual time=2.769..14,319.945 rows=357,283 loops=1)

  • Join Filter: ((pr.cid = lt.cid) AND (COALESCE(NULLIF(pr.lease_term_id, 0), lt.id) = lt.id))
  • Rows Removed by Join Filter: 7593825
3. 7.257 46.098 ↓ 3,454.0 3,454 1

Nested Loop Left Join (cost=53.05..225.59 rows=1 width=265) (actual time=2.757..46.098 rows=3,454 loops=1)

4. 7.676 31.933 ↓ 3,454.0 3,454 1

Nested Loop (cost=52.90..225.40 rows=1 width=261) (actual time=2.748..31.933 rows=3,454 loops=1)

5. 7.426 13.895 ↓ 3,454.0 3,454 1

Hash Join (cost=52.63..225.05 rows=1 width=249) (actual time=2.732..13.895 rows=3,454 loops=1)

  • Hash Cond: ((pr.cid = psc.cid) AND (pr.property_id = psc.property_id))
  • Join Filter: (COALESCE(NULLIF(pr.space_configuration_id, 0), sc.id) = sc.id)
6. 3.765 3.765 ↑ 1.0 3,454 1

Seq Scan on propsect_rates1 pr (cost=0.00..125.54 rows=3,454 width=237) (actual time=0.008..3.765 rows=3,454 loops=1)

7. 0.640 2.704 ↓ 5.0 1,217 1

Hash (cost=48.95..48.95 rows=245 width=20) (actual time=2.704..2.704 rows=1,217 loops=1)

  • Buckets: 2048 (originally 1024) Batches: 1 (originally 1) Memory Usage: 78kB
8. 1.246 2.064 ↓ 5.0 1,217 1

Hash Join (cost=5.45..48.95 rows=245 width=20) (actual time=0.098..2.064 rows=1,217 loops=1)

  • Hash Cond: ((psc.cid = sc.cid) AND (psc.space_configuration_id = sc.id))
9. 0.737 0.737 ↑ 1.0 1,587 1

Seq Scan on property_space_configurations psc (cost=0.00..34.74 rows=1,624 width=12) (actual time=0.005..0.737 rows=1,587 loops=1)

  • Filter: show_on_website
  • Rows Removed by Filter: 87
10. 0.028 0.081 ↓ 1.9 48 1

Hash (cost=5.08..5.08 rows=25 width=8) (actual time=0.081..0.081 rows=48 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
11. 0.053 0.053 ↓ 1.9 48 1

Seq Scan on space_configurations sc (cost=0.00..5.08 rows=25 width=8) (actual time=0.005..0.053 rows=48 loops=1)

  • Filter: ((deleted_on IS NULL) AND (id = ANY ('{1,2}'::integer[])))
  • Rows Removed by Filter: 118
12. 10.362 10.362 ↑ 1.0 1 3,454

Index Scan using idx_property_charge_settings_property_id on property_charge_settings pcs (cost=0.28..0.34 rows=1 width=16) (actual time=0.002..0.003 rows=1 loops=3,454)

  • Index Cond: (property_id = pr.property_id)
  • Filter: (pr.cid = cid)
13. 6.908 6.908 ↑ 1.0 1 3,454

Index Scan using pk_lease_start_structures on lease_start_structures lss (cost=0.15..0.19 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=3,454)

  • Index Cond: ((pcs.cid = cid) AND (pcs.lease_start_structure_id = id))
  • Filter: (is_published AND (deleted_on IS NULL))
14. 10,887.008 10,887.008 ↓ 32.0 2,302 3,454

Index Scan using pk_lease_terms on lease_terms lt (cost=0.29..8.58 rows=72 width=12) (actual time=0.003..3.152 rows=2,302 loops=3,454)

  • Index Cond: (cid = psc.cid)
  • Filter: ((NOT is_disabled) AND (deleted_on IS NULL) AND (NOT is_disabled) AND is_prospect AND show_on_website AND (lease_term_type_id = 1))
  • Rows Removed by Filter: 2488
15. 357.283 357.283 ↓ 0.0 0 357,283

Index Scan using idx_lease_start_windows_property_id on lease_start_windows lsw (cost=0.29..1.17 rows=5 width=16) (actual time=0.001..0.001 rows=0 loops=357,283)

  • Index Cond: (pcs.property_id = property_id)
  • Filter: (is_active AND (deleted_on IS NULL) AND (lease_term_type_id IS NULL))
Planning time : 7.254 ms