explain.depesz.com

PostgreSQL's explain analyze made readable

Result: udK8

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

Unique (cost=29,061.79..29,061.80 rows=1 width=113) (actual time=1,754.306..1,754.306 rows=0 loops=1)

2. 0.006 1,754.305 ↓ 0.0 0 1

Sort (cost=29,061.79..29,061.79 rows=1 width=113) (actual time=1,754.305..1,754.305 rows=0 loops=1)

  • Sort Key: l.id
  • Sort Method: quicksort Memory: 25kB
3. 36.824 1,754.299 ↓ 0.0 0 1

Nested Loop (cost=17,590.16..29,061.78 rows=1 width=113) (actual time=1,754.299..1,754.299 rows=0 loops=1)

  • Join Filter: (l.id = cll.lease_id)
4. 75.624 588.373 ↓ 86,854.0 86,854 1

Nested Loop (cost=17,589.73..29,059.23 rows=1 width=117) (actual time=196.267..588.373 rows=86,854 loops=1)

5. 65.532 252.187 ↓ 86,854.0 86,854 1

Hash Right Join (cost=17,589.31..29,058.65 rows=1 width=113) (actual time=196.242..252.187 rows=86,854 loops=1)

  • Hash Cond: ((i.cid = l.cid) AND (i.lease_id = l.id))
  • Filter: (i.id IS NULL)
  • Rows Removed by Filter: 22,739
6. 0.817 25.948 ↓ 1.2 23,653 1

Gather (cost=1,000.00..12,364.21 rows=20,026 width=12) (actual time=0.334..25.948 rows=23,653 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
7. 25.131 25.131 ↑ 1.1 7,884 3 / 3

Parallel Seq Scan on inspections i (cost=0.00..9,361.61 rows=8,344 width=12) (actual time=0.049..25.131 rows=7,884 loops=3)

  • Filter: ((deleted_on IS NULL) AND (scheduled_task_id = 178,377) AND (cid = 2,603))
  • Rows Removed by Filter: 77,090
8. 20.887 160.707 ↑ 1.0 109,211 1

Hash (cost=12,576.94..12,576.94 rows=114,639 width=113) (actual time=160.707..160.707 rows=109,211 loops=1)

  • Buckets: 131,072 Batches: 1 Memory Usage: 13,523kB
9. 139.820 139.820 ↑ 1.0 109,211 1

Index Scan using idx_leases_cid_property_id_primary_customer_id on leases l (cost=0.42..12,576.94 rows=114,639 width=113) (actual time=0.028..139.820 rows=109,211 loops=1)

  • Index Cond: ((cid = 2,603) AND (property_id = ANY ('{173769,125433,108879,125426,108878,125436,125437,125438,125440,125428,125431,125425,125427,125429,125432,153067,125435,153068,168100,168101,168102,168103,685693,125446,125430,204600,125456,329673,327978,125458,359072,125441,359073,401231,329250,204601}'::integer[])))
  • Filter: ((property_unit_id IS NOT NULL) AND (occupancy_type_id = ANY ('{1,10}'::integer[])))
  • Rows Removed by Filter: 86,986
10. 260.562 260.562 ↑ 1.0 1 86,854

Index Scan using idx_lease_processes_lease_id on lease_processes lp (cost=0.42..0.55 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=86,854)

  • Index Cond: (lease_id = l.id)
  • Filter: ((customer_id IS NULL) AND (cid = 2,603))
  • Rows Removed by Filter: 0
11. 1,129.102 1,129.102 ↓ 0.0 0 86,854

Index Scan using idx_cached_lease_logs_cid_lease_id_log_datetime_date on cached_lease_logs cll (cost=0.43..2.51 rows=1 width=8) (actual time=0.013..0.013 rows=0 loops=86,854)

  • Index Cond: ((cid = 2,603) AND (lease_id = lp.lease_id))
  • Filter: ((old_lease_status_type_id = 5) AND (lease_status_type_id = 6) AND (date(log_datetime) = '03/24/2020'::date))
  • Rows Removed by Filter: 14
Planning time : 1.654 ms
Execution time : 1,754.537 ms