explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 89wV

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 2,090.224 ↓ 0.0 0 1

Limit (cost=450.03..450.08 rows=1 width=16) (actual time=2,090.223..2,090.224 rows=0 loops=1)

2. 0.003 2,090.222 ↓ 0.0 0 1

GroupAggregate (cost=450.03..450.08 rows=1 width=16) (actual time=2,090.221..2,090.222 rows=0 loops=1)

  • Group Key: li.cid, li.id, lp.is_test
  • Filter: ((sum(sc.charge_amount))::double precision < '1000000000'::double precision)
3. 0.021 2,090.219 ↓ 0.0 0 1

Sort (cost=450.03..450.03 rows=1 width=21) (actual time=2,090.219..2,090.219 rows=0 loops=1)

  • Sort Key: li.cid, li.id, lp.is_test
  • Sort Method: quicksort Memory: 25kB
4. 30.351 2,090.198 ↓ 0.0 0 1

Nested Loop (cost=2.11..450.02 rows=1 width=21) (actual time=2,090.197..2,090.198 rows=0 loops=1)

5. 102.345 1,974.207 ↓ 42,820.0 42,820 1

Nested Loop (cost=1.96..449.83 rows=1 width=25) (actual time=14.622..1,974.207 rows=42,820 loops=1)

  • Join Filter: ((lc.cid = lps.cid) AND (lc.lease_id = lps.lease_id))
6. 87.134 1,700.582 ↓ 42,820.0 42,820 1

Nested Loop (cost=1.54..449.32 rows=1 width=45) (actual time=14.583..1,700.582 rows=42,820 loops=1)

  • Join Filter: ((lc.cid = sc.cid) AND (lc.lease_id = sc.lease_id))
7. 110.579 863.138 ↓ 5,684.2 34,105 1

Nested Loop (cost=1.11..445.00 rows=6 width=28) (actual time=13.394..863.138 rows=34,105 loops=1)

8. 72.587 443.243 ↓ 3,093.2 77,329 1

Nested Loop (cost=0.68..431.00 rows=25 width=20) (actual time=13.328..443.243 rows=77,329 loops=1)

9. 13.332 13.332 ↓ 66.0 66 1

Function Scan on load_properties lp (cost=0.25..2.00 rows=1 width=12) (actual time=13.225..13.332 rows=66 loops=1)

  • Filter: ((property_type_id <> 38) AND (is_disabled = 0))
  • Rows Removed by Filter: 2
10. 357.324 357.324 ↓ 9.5 1,172 66

Index Scan using idx_lease_intervals_cid_propid_leaseid on lease_intervals li (cost=0.43..425.31 rows=123 width=16) (actual time=0.014..5.414 rows=1,172 loops=66)

  • Index Cond: ((cid = lp.cid) AND (property_id = lp.property_id))
  • Filter: ((lease_end_date IS NOT NULL) AND (lease_interval_type_id <> ALL ('{2,4}'::integer[])) AND (lease_end_date > lease_start_date) AND (lease_status_type_id = ANY ('{1,3,4,5,6}'::integer[])))
  • Rows Removed by Filter: 378
11. 309.316 309.316 ↓ 0.0 0 77,329

Index Scan using idx_lease_customers_cid_lease_id_customer_id_lease_status_type_ on lease_customers lc (cost=0.43..0.53 rows=1 width=8) (actual time=0.003..0.004 rows=0 loops=77,329)

  • Index Cond: ((cid = li.cid) AND (lease_id = li.lease_id))
  • Filter: ((lease_status_type_id <> 2) AND (customer_type_id = 1))
  • Rows Removed by Filter: 0
12. 750.310 750.310 ↑ 1.0 1 34,105

Index Scan using idx_scheduled_charges_remote_primary_key on scheduled_charges sc (cost=0.43..0.68 rows=1 width=21) (actual time=0.016..0.022 rows=1 loops=34,105)

  • Index Cond: ((cid = li.cid) AND (lease_id = li.lease_id))
  • Filter: ((deleted_on IS NULL) AND (deleted_by IS NULL) AND (total_value IS NULL) AND (is_unselected_quote IS FALSE) AND (li.id = lease_interval_id))
  • Rows Removed by Filter: 13
13. 171.280 171.280 ↑ 1.0 1 42,820

Index Scan using idx_lease_processes_cid_lease_id_customer_id on lease_processes lps (cost=0.43..0.48 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=42,820)

  • Index Cond: ((cid = sc.cid) AND (lease_id = sc.lease_id))
  • Filter: (customer_id IS NULL)
  • Rows Removed by Filter: 0
14. 85.640 85.640 ↓ 0.0 0 42,820

Index Scan using pk_ar_triggers on ar_triggers art (cost=0.14..0.18 rows=1 width=4) (actual time=0.002..0.002 rows=0 loops=42,820)

  • Index Cond: (id = sc.ar_trigger_id)
  • Rows Removed by Filter: 1
Planning time : 13.666 ms
Execution time : 2,091.152 ms