explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0dO : Optimization for: Optimization for: Optimization for: plan #jgjA; plan #MG0f; plan #MdTW

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.056 343.294 ↓ 50.0 50 1

Limit (cost=42.55..43.07 rows=1 width=164) (actual time=342.961..343.294 rows=50 loops=1)

2. 0.967 343.238 ↓ 50.0 50 1

Result (cost=42.55..43.07 rows=1 width=164) (actual time=342.959..343.238 rows=50 loops=1)

3. 0.260 342.271 ↓ 50.0 50 1

Sort (cost=42.55..42.55 rows=1 width=150) (actual time=342.250..342.271 rows=50 loops=1)

  • Sort Key: ssc.viewed_on DESC, ssc.id DESC, lap.property_name
  • Sort Method: top-N heapsort Memory: 47kB
4. 0.343 342.011 ↓ 116.0 116 1

Nested Loop Left Join (cost=14.50..42.54 rows=1 width=150) (actual time=296.161..342.011 rows=116 loops=1)

  • Join Filter: (c.cid = ssca.cid)
5. 0.201 329.836 ↓ 116.0 116 1

Nested Loop Left Join (cost=14.07..38.78 rows=1 width=134) (actual time=296.145..329.836 rows=116 loops=1)

6. 0.229 304.579 ↓ 116.0 116 1

Nested Loop Left Join (cost=13.65..30.45 rows=1 width=129) (actual time=296.141..304.579 rows=116 loops=1)

7. 0.251 303.886 ↓ 116.0 116 1

Nested Loop (cost=13.22..22.06 rows=1 width=129) (actual time=296.135..303.886 rows=116 loops=1)

8. 0.184 303.519 ↓ 116.0 116 1

Nested Loop (cost=13.09..21.79 rows=1 width=120) (actual time=296.127..303.519 rows=116 loops=1)

9. 0.265 303.103 ↓ 116.0 116 1

Nested Loop (cost=12.96..21.50 rows=1 width=104) (actual time=296.116..303.103 rows=116 loops=1)

  • Join Filter: (lap.property_id = ssc.property_id)
10. 0.181 294.254 ↓ 38.7 116 1

Hash Join (cost=12.81..18.97 rows=3 width=68) (actual time=293.946..294.254 rows=116 loops=1)

  • Hash Cond: (ssca.property_id = lap.property_id)
11. 1.512 1.512 ↑ 1.0 127 1

Seq Scan on subsidy_special_claim_associations ssca (cost=0.00..5.65 rows=127 width=28) (actual time=1.373..1.512 rows=127 loops=1)

  • Filter: (cid = 235)
  • Rows Removed by Filter: 85
12. 0.068 292.561 ↓ 21.0 105 1

Hash (cost=12.75..12.75 rows=5 width=40) (actual time=292.560..292.561 rows=105 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
13. 292.493 292.493 ↓ 21.0 105 1

Function Scan on load_affordable_properties lap (cost=0.25..12.75 rows=5 width=40) (actual time=292.432..292.493 rows=105 loops=1)

  • Filter: (cid = 235)
14. 8.584 8.584 ↑ 1.0 1 116

Index Scan using pk_subsidy_special_claims on subsidy_special_claims ssc (cost=0.14..0.83 rows=1 width=60) (actual time=0.074..0.074 rows=1 loops=116)

  • Index Cond: ((cid = 235) AND (id = ssca.subsidy_special_claim_id))
  • Filter: ((subsidy_special_claim_status_type_id <> 2) AND (ssca.property_id = property_id))
15. 0.232 0.232 ↑ 1.0 1 116

Index Scan using pk_subsidy_special_claim_types on subsidy_special_claim_types ssst (cost=0.13..0.24 rows=1 width=20) (actual time=0.002..0.002 rows=1 loops=116)

  • Index Cond: (id = ssc.subsidy_special_claim_type_id)
16. 0.116 0.116 ↑ 1.0 1 116

Index Scan using pk_subsidy_special_claim_status_types on subsidy_special_claim_status_types sscst (cost=0.13..0.24 rows=1 width=13) (actual time=0.001..0.001 rows=1 loops=116)

  • Index Cond: (id = ssc.subsidy_special_claim_status_type_id)
17. 0.464 0.464 ↑ 1.0 1 116

Index Scan using pk_cached_leases on cached_leases cl (cost=0.43..8.39 rows=1 width=12) (actual time=0.004..0.004 rows=1 loops=116)

  • Index Cond: ((cid = ssca.cid) AND (cid = 235) AND (id = ssca.lease_id))
18. 25.056 25.056 ↑ 1.0 1 116

Index Scan using idx_unit_spaces on unit_spaces us (cost=0.42..8.32 rows=1 width=13) (actual time=0.216..0.216 rows=1 loops=116)

  • Index Cond: (ssca.unit_space_id = id)
  • Filter: ((cid = 235) AND (ssca.cid = cid))
19. 11.832 11.832 ↑ 1.0 1 116

Index Scan using idx_customers_id on customers c (cost=0.43..3.74 rows=1 width=26) (actual time=0.102..0.102 rows=1 loops=116)

  • Index Cond: (id = cl.primary_customer_id)
  • Filter: (cid = 235)
Planning time : 26.011 ms