explain.depesz.com

PostgreSQL's explain analyze made readable

Result: sd5g

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 705.564 ↓ 0.0 0 1

Unique (cost=3,195.47..3,195.48 rows=1 width=114) (actual time=705.564..705.564 rows=0 loops=1)

2. 0.017 705.563 ↓ 0.0 0 1

Sort (cost=3,195.47..3,195.48 rows=1 width=114) (actual time=705.563..705.563 rows=0 loops=1)

  • Sort Key: l.id
  • Sort Method: quicksort Memory: 25kB
3. 0.040 705.546 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.72..3,195.46 rows=1 width=114) (actual time=705.546..705.546 rows=0 loops=1)

  • Filter: (i.id IS NULL)
  • Rows Removed by Filter: 4
4. 0.020 698.478 ↓ 4.0 4 1

Nested Loop (cost=1.28..3,190.42 rows=1 width=114) (actual time=110.424..698.478 rows=4 loops=1)

5. 8.777 698.406 ↓ 4.0 4 1

Nested Loop (cost=0.85..3,188.03 rows=1 width=118) (actual time=110.405..698.406 rows=4 loops=1)

6. 29.529 29.529 ↓ 19.3 14,350 1

Index Scan using idx_leases_cid_property_id_primary_customer_id on leases l (cost=0.42..1,323.87 rows=744 width=114) (actual time=0.027..29.529 rows=14,350 loops=1)

  • Index Cond: ((cid = 13,576) AND (property_id = ANY ('{679024,267563,544117,628940,529777,598061,529778,628941,267566,598062,1045265,347830,267573,267574,719751}'::integer[])))
  • Filter: ((property_unit_id IS NOT NULL) AND (occupancy_type_id = ANY ('{1,10}'::integer[])))
  • Rows Removed by Filter: 6,119
7. 660.100 660.100 ↓ 0.0 0 14,350

Index Scan using idx_cached_lease_logs_cid_property_id_lease_id_reporting_month on cached_lease_logs cll (cost=0.43..2.48 rows=1 width=12) (actual time=0.046..0.046 rows=0 loops=14,350)

  • Index Cond: ((cid = 13,576) AND (property_id = l.property_id) AND (lease_id = l.id))
  • Filter: ((old_lease_status_type_id = 5) AND (lease_status_type_id = 6) AND (date(log_datetime) = '07/29/2020'::date))
  • Rows Removed by Filter: 14
8. 0.052 0.052 ↑ 1.0 1 4

Index Scan using idx_lease_processes_cid_lease_id_customer_id on lease_processes lp (cost=0.42..2.36 rows=1 width=8) (actual time=0.013..0.013 rows=1 loops=4)

  • Index Cond: ((cid = 13,576) AND (lease_id = l.id))
  • Filter: (customer_id IS NULL)
9. 0.040 7.028 ↑ 1.0 1 4

Bitmap Heap Scan on inspections i (cost=1.44..5.01 rows=1 width=466) (actual time=1.757..1.757 rows=1 loops=4)

  • Recheck Cond: ((l.id = lease_id) OR (l.property_unit_id = property_unit_id))
  • Filter: ((deleted_on IS NULL) AND (scheduled_task_id = 7,814,774) AND (cid = 13,576) AND (l.cid = cid) AND ((l.id = lease_id) OR ((l.property_unit_id = property_unit_id) AND (lease_id IS NULL) AND ((inspection_details ->> 'lease_ids'::text) IS NOT NULL) AND (strpos((inspection_details ->> 'lease_ids'::text), (l.id)::text) > 0))))
  • Rows Removed by Filter: 1
  • Heap Blocks: exact=8
10. 0.016 6.988 ↓ 0.0 0 4

BitmapOr (cost=1.44..1.44 rows=10 width=0) (actual time=1.747..1.747 rows=0 loops=4)

11. 5.504 5.504 ↑ 1.5 2 4

Bitmap Index Scan on idx_inspections_lease_id (cost=0.00..0.73 rows=3 width=0) (actual time=1.376..1.376 rows=2 loops=4)

  • Index Cond: (l.id = lease_id)
12. 1.468 1.468 ↑ 3.0 2 4

Bitmap Index Scan on idx_inspections_property_unit_id (cost=0.00..0.71 rows=6 width=0) (actual time=0.367..0.367 rows=2 loops=4)

  • Index Cond: (l.property_unit_id = property_unit_id)
Planning time : 9.730 ms
Execution time : 705.709 ms