explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8jCy

Settings
# exclusive inclusive rows x rows loops node
1. 5,775.664 10,052.070 ↓ 25,485.0 25,485 1

GroupAggregate (cost=119,123.24..119,123.54 rows=1 width=72) (actual time=4,146.707..10,052.070 rows=25,485 loops=1)

  • Group Key: sc.lease_id, sc.lease_interval_id
2. 538.346 4,276.406 ↓ 534,170.0 534,170 1

Sort (cost=119,123.24..119,123.24 rows=1 width=33) (actual time=4,146.462..4,276.406 rows=534,170 loops=1)

  • Sort Key: sc.lease_id, sc.lease_interval_id
  • Sort Method: quicksort Memory: 66309kB
3. 521.560 3,738.060 ↓ 534,170.0 534,170 1

Nested Loop Left Join (cost=5,838.15..119,123.23 rows=1 width=33) (actual time=39.581..3,738.060 rows=534,170 loops=1)

4. 81.618 867.320 ↓ 65,255.0 65,255 1

Nested Loop (cost=5,832.75..119,113.80 rows=1 width=32) (actual time=39.517..867.320 rows=65,255 loops=1)

5. 47.134 459.427 ↓ 34.0 65,255 1

Hash Join (cost=5,832.32..112,936.96 rows=1,920 width=28) (actual time=39.489..459.427 rows=65,255 loops=1)

  • Hash Cond: (sc.property_id = load_prop.property_id)
6. 382.974 412.261 ↓ 2.5 65,255 1

Bitmap Heap Scan on scheduled_charges sc (cost=5,830.81..112,817.01 rows=26,464 width=32) (actual time=39.447..412.261 rows=65,255 loops=1)

  • Recheck Cond: (cid = 8132)
  • Filter: ((deleted_by IS NULL) AND (deleted_on IS NULL) AND (NOT is_unselected_quote) AND (ar_trigger_id = ANY ('{301,302,303,304,305,306,307,308,309,310}'::integer[])))
  • Rows Removed by Filter: 242130
  • Heap Blocks: exact=52479
7. 29.287 29.287 ↑ 1.0 307,424 1

Bitmap Index Scan on pk_scheduled_charges (cost=0.00..5,824.19 rows=315,168 width=0) (actual time=29.286..29.287 rows=307,424 loops=1)

  • Index Cond: (cid = 8132)
8. 0.009 0.032 ↑ 1.0 23 1

Hash (cost=1.23..1.23 rows=23 width=4) (actual time=0.032..0.032 rows=23 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
9. 0.023 0.023 ↑ 1.0 23 1

Seq Scan on load_prop (cost=0.00..1.23 rows=23 width=4) (actual time=0.017..0.023 rows=23 loops=1)

10. 326.275 326.275 ↑ 1.0 1 65,255

Index Scan using idx_lease_intervals on lease_intervals li (cost=0.43..3.21 rows=1 width=16) (actual time=0.005..0.005 rows=1 loops=65,255)

  • Index Cond: (id = sc.lease_interval_id)
  • Filter: ((cid = 8132) AND (sc.lease_id = lease_id))
  • Rows Removed by Filter: 0
11. 1,044.080 2,349.180 ↓ 8.0 8 65,255

Bitmap Heap Scan on ar_transactions at (cost=5.39..9.41 rows=1 width=21) (actual time=0.023..0.036 rows=8 loops=65,255)

  • Recheck Cond: ((scheduled_charge_id = sc.id) AND (lease_id = sc.lease_id))
  • Filter: ((cid = 8132) AND (cid = sc.cid))
  • Heap Blocks: exact=462666
12. 103.390 1,305.100 ↓ 0.0 0 65,255

BitmapAnd (cost=5.39..5.39 rows=1 width=0) (actual time=0.020..0.020 rows=0 loops=65,255)

13. 391.530 391.530 ↑ 1.2 8 65,255

Bitmap Index Scan on idx_ar_transactions_scheduled_charge_id (cost=0.00..1.53 rows=10 width=0) (actual time=0.006..0.006 rows=8 loops=65,255)

  • Index Cond: (scheduled_charge_id = sc.id)
14. 810.180 810.180 ↓ 1.3 121 54,012

Bitmap Index Scan on idx_ar_transactions_lease_id (cost=0.00..3.61 rows=92 width=0) (actual time=0.015..0.015 rows=121 loops=54,012)

  • Index Cond: (lease_id = sc.lease_id)
Planning time : 2.409 ms