explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WslS

Settings
# exclusive inclusive rows x rows loops node
1. 0.082 20,682.748 ↓ 22.0 22 1

Nested Loop (cost=84,370.98..99,955.23 rows=1 width=24) (actual time=1,739.724..20,682.748 rows=22 loops=1)

2. 1,966.766 20,682.490 ↓ 22.0 22 1

Nested Loop Left Join (cost=84,370.83..99,955.04 rows=1 width=28) (actual time=1,739.681..20,682.490 rows=22 loops=1)

  • Join Filter: ((li.cid = old_lease_interval.cid) AND (li.lease_id = old_lease_interval.lease_id))
  • Rows Removed by Join Filter: 5,048,464
3. 9.032 59.174 ↓ 22.0 22 1

Nested Loop (cost=0.43..4,144.63 rows=1 width=20) (actual time=58.722..59.174 rows=22 loops=1)

4. 14.846 14.846 ↓ 183.8 8,824 1

Seq Scan on temp_lease_activity tla (cost=0.00..3,312.74 rows=48 width=8) (actual time=0.027..14.846 rows=8,824 loops=1)

  • Filter: (cid = 13,531)
5. 35.296 35.296 ↓ 0.0 0 8,824

Index Scan using idx_lease_intervals_major_composite on lease_intervals li (cost=0.43..17.32 rows=1 width=20) (actual time=0.004..0.004 rows=0 loops=8,824)

  • Index Cond: ((cid = 13,531) AND (lease_id = tla.lease_id))
  • Filter: ((lease_status_type_id <> 2) AND (lease_start_date >= '2020-09-01'::date) AND (lease_start_date < '2020-10-01 00:00:00'::timestamp without time zone) AND (lease_interval_type_id = 3))
  • Rows Removed by Filter: 2
6. 4,925.536 18,656.550 ↓ 150.8 229,476 22

Subquery Scan on old_lease_interval (cost=84,370.41..95,787.58 rows=1,522 width=16) (actual time=46.006..848.025 rows=229,476 loops=22)

  • Filter: ((old_lease_interval.row_number = 1) AND (old_lease_interval.cid = 13,531))
  • Rows Removed by Filter: 130,253
7. 8,983.524 13,731.014 ↓ 1.2 359,729 22

WindowAgg (cost=84,370.41..91,220.71 rows=304,458 width=32) (actual time=46.005..624.137 rows=359,729 loops=22)

8. 4,043.027 4,747.490 ↓ 1.2 359,729 22

Sort (cost=84,370.41..85,131.55 rows=304,458 width=20) (actual time=46.002..215.795 rows=359,729 loops=22)

  • Sort Key: li_1.lease_id, li_1.lease_start_date DESC, li_1.id DESC
  • Sort Method: quicksort Memory: 38,857kB
9. 305.189 704.463 ↓ 1.2 359,729 1

Hash Join (cost=11.95..56,640.55 rows=304,458 width=20) (actual time=0.242..704.463 rows=359,729 loops=1)

  • Hash Cond: (li_1.property_id = load_prop_1.property_id)
10. 399.050 399.050 ↓ 1.2 361,139 1

Seq Scan on lease_intervals li_1 (cost=0.00..52,442.30 rows=304,458 width=24) (actual time=0.008..399.050 rows=361,139 loops=1)

  • Filter: ((lease_status_type_id <> 2) AND (lease_start_date < '2020-09-30'::date) AND (lease_end_date < '2020-09-30'::date) AND (cid = 13,531))
  • Rows Removed by Filter: 1,087,276
11. 0.101 0.224 ↑ 1.0 220 1

Hash (cost=9.20..9.20 rows=220 width=4) (actual time=0.223..0.224 rows=220 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 16kB
12. 0.123 0.123 ↑ 1.0 220 1

Seq Scan on load_prop load_prop_1 (cost=0.00..9.20 rows=220 width=4) (actual time=0.008..0.123 rows=220 loops=1)

13. 0.176 0.176 ↑ 1.0 1 22

Index Only Scan using idx_load_prop_property_id on load_prop (cost=0.14..0.19 rows=1 width=4) (actual time=0.007..0.008 rows=1 loops=22)

  • Index Cond: (property_id = li.property_id)
  • Heap Fetches: 22
Planning time : 1.295 ms