explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ovnu

Settings
# exclusive inclusive rows x rows loops node
1. 44.398 4,650.503 ↓ 0.0 0 1

Delete on rate_logs rl (cost=57,472.71..58,226.40 rows=7 width=18) (actual time=4,650.503..4,650.503 rows=0 loops=1)

2. 0.000 4,606.105 ↓ 4,699.9 32,899 1

Nested Loop (cost=57,472.71..58,226.40 rows=7 width=18) (actual time=48.144..4,606.105 rows=32,899 loops=1)

3. 10.320 4,514.441 ↓ 6,317.4 31,587 1

Nested Loop (cost=57,472.14..58,038.95 rows=5 width=24) (actual time=48.130..4,514.441 rows=31,587 loops=1)

4. 34.744 81.941 ↓ 7,896.8 31,587 1

Index Scan using idx_rates_cid_property_id_unit_space_id on rates r (cost=57,471.85..57,698.76 rows=4 width=22) (actual time=48.033..81.941 rows=31,587 loops=1)

  • Index Cond: ((cid = 3482) AND (property_id = 508410) AND (unit_space_id = ANY ('{4206468,4206577,4206540,4206474,4206509,4206546,4206548,4206583,4206585,4206476,4206511,4206513,4206550,4206587,4206470,4206472,4206477,4206479,4206495,4206505,4206512,4206515,4206516,4206521,4206558,4206579,4206581,4206586,4206596,4206460,4206462,4206464,4206484,4206485,4206497,4206499,4206507,4206534,4206536,4206542,4206544,4206549,4206552,4206553,4206559,4206569,4206571,4206573,4206589,4206590,4206595,4206506,4206543,4206508,4206545,4206582,4206475,4206510,4206547,4206584,4206487,4206524,4206598,4206526,4206489,4206563,4206600,4206593,4206482,4206519,4206556,4206469,4206504,4206488,4206525,4206562,4206599,4206466,4206530,4206458,4206493,4206567,4206501,4206538,4206575,4206527,4206455,4206490,4206564,4206481,4206514,4206551,4206555,4206478,4206518,4206486,4206502,4206528,4206535,4206560,4206565,4206572,4206576,4206594,4206597,4206456,4206463,4206465,4206467,4206483,4206491,4206520,4206523,4206537,4206539,4206557,4206574,4206588,4206592,4206461,4206496,4206533,4206570,4206529,4206566,4206457,4206492,4206459,4206568,4206531,4206591,4206517}'::integer[])))
  • Filter: ((NOT is_renewal) AND (lease_term_id <> 0) AND (ar_trigger_id = 307) AND (ar_phase_id = 2) AND (ar_cascade_id = 4) AND (ar_origin_id = 1) AND (NOT (hashed SubPlan 1)))
  • Rows Removed by Filter: 2096
5.          

SubPlan (for Index Scan)

6. 47.197 47.197 ↑ 1.3 3,920 1

Index Scan using idx_scheduled_charges_property_id on scheduled_charges (cost=0.43..57,458.47 rows=5,131 width=12) (actual time=0.015..47.197 rows=3,920 loops=1)

  • Index Cond: (property_id = 508410)
  • Filter: ((rate_id IS NOT NULL) AND (deleted_on IS NULL) AND (cid = 3482) AND (created_on > (now() - '6 mons'::interval)))
  • Rows Removed by Filter: 70713
7. 4,422.180 4,422.180 ↑ 1.0 1 31,587

Index Scan using pk_lease_terms on lease_terms lt (cost=0.29..85.04 rows=1 width=10) (actual time=0.069..0.140 rows=1 loops=31,587)

  • Index Cond: (id = r.lease_term_id)
  • Filter: (lease_term_type_id <> 2)
8. 94.761 94.761 ↑ 41.0 1 31,587

Index Scan using idx_rate_logs_cid_rate_id on rate_logs rl (cost=0.57..37.08 rows=41 width=18) (actual time=0.002..0.003 rows=1 loops=31,587)

  • Index Cond: ((cid = 3482) AND (rate_id = r.id))
Planning time : 1.015 ms
Execution time : 4,650.566 ms