explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BpjQ : Optimization for: Optimization for: Optimization for: Optimization for: plan #jgjA; plan #MG0f; plan #MdTW; plan #0BqQ

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.064 413.453 ↓ 50.0 50 1

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

2. 1.118 413.389 ↓ 50.0 50 1

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

3. 0.315 412.271 ↓ 50.0 50 1

Sort (cost=42.55..42.55 rows=1 width=150) (actual time=412.246..412.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.264 411.956 ↓ 116.0 116 1

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

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

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

6. 0.262 364.036 ↓ 116.0 116 1

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

7. 0.251 363.426 ↓ 116.0 116 1

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

8. 0.198 363.059 ↓ 116.0 116 1

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

9. 0.641 362.629 ↓ 116.0 116 1

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

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

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

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

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

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

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

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

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

  • Filter: (cid = 235)
14. 9.396 9.396 ↑ 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.081..0.081 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.348 0.348 ↑ 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.003..0.003 rows=1 loops=116)

  • Index Cond: ((cid = ssca.cid) AND (cid = 235) AND (id = ssca.lease_id))
18. 46.748 46.748 ↑ 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.403..0.403 rows=1 loops=116)

  • Index Cond: (ssca.unit_space_id = id)
  • Filter: ((cid = 235) AND (ssca.cid = cid))
19. 0.696 0.696 ↑ 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.006..0.006 rows=1 loops=116)

  • Index Cond: (id = cl.primary_customer_id)
  • Filter: (cid = 235)