explain.depesz.com

PostgreSQL's explain analyze made readable

Result: yyRB

Settings
# exclusive inclusive rows x rows loops node
1. 2.386 113.669 ↓ 3.4 2,954 1

GroupAggregate (cost=18,386.37..18,442.15 rows=879 width=76) (actual time=111.048..113.669 rows=2,954 loops=1)

  • Group Key: sub1.cid, sub1.ap_payment_id, sub1.property_name, sub1.property_ids
2. 1.496 111.283 ↓ 1.2 3,239 1

Sort (cost=18,386.37..18,393.09 rows=2,685 width=84) (actual time=111.033..111.283 rows=3,239 loops=1)

  • Sort Key: sub1.cid, sub1.ap_payment_id, sub1.property_name, sub1.property_ids
  • Sort Method: quicksort Memory: 552kB
3. 0.528 109.787 ↓ 1.2 3,239 1

Subquery Scan on sub1 (cost=18,139.48..18,233.45 rows=2,685 width=84) (actual time=105.797..109.787 rows=3,239 loops=1)

4. 3.143 109.259 ↓ 1.2 3,239 1

WindowAgg (cost=18,139.48..18,206.60 rows=2,685 width=84) (actual time=105.795..109.259 rows=3,239 loops=1)

5. 2.735 106.116 ↓ 1.2 3,239 1

Sort (cost=18,139.48..18,146.19 rows=2,685 width=80) (actual time=105.774..106.116 rows=3,239 loops=1)

  • Sort Key: ah.ap_payment_id
  • Sort Method: quicksort Memory: 552kB
6. 3.463 103.381 ↓ 1.2 3,239 1

Nested Loop (cost=1,004.59..17,986.56 rows=2,685 width=80) (actual time=10.540..103.381 rows=3,239 loops=1)

7. 8.686 18.943 ↓ 1.2 3,239 1

Bitmap Heap Scan on ap_headers ah (cost=1,003.88..3,307.44 rows=2,685 width=16) (actual time=10.378..18.943 rows=3,239 loops=1)

  • Recheck Cond: ((cid = 8839) AND (ap_payment_id IS NOT NULL))
  • Heap Blocks: exact=735
8. 0.145 10.257 ↓ 0.0 0 1

BitmapAnd (cost=1,003.88..1,003.88 rows=2,685 width=0) (actual time=10.257..10.257 rows=0 loops=1)

9. 1.048 1.048 ↓ 1.0 7,609 1

Bitmap Index Scan on pk_ap_headers (cost=0.00..78.66 rows=7,365 width=0) (actual time=1.048..1.048 rows=7,609 loops=1)

  • Index Cond: (cid = 8839)
10. 9.064 9.064 ↓ 1.1 85,889 1

Bitmap Index Scan on idx_ap_headers_ap_payment_id (cost=0.00..923.63 rows=81,761 width=0) (actual time=9.064..9.064 rows=85,889 loops=1)

  • Index Cond: (ap_payment_id IS NOT NULL)
11. 19.434 80.975 ↑ 1.0 1 3,239

GroupAggregate (cost=0.71..5.45 rows=1 width=68) (actual time=0.025..0.025 rows=1 loops=3,239)

  • Group Key: ad.ap_header_id
12. 9.402 61.541 ↓ 3.0 3 3,239

Nested Loop (cost=0.71..5.43 rows=1 width=23) (actual time=0.011..0.019 rows=3 loops=3,239)

13. 35.629 35.629 ↓ 3.0 3 3,239

Index Scan using idx_ap_details_cid_apheaderid on ap_details ad (cost=0.42..2.45 rows=1 width=12) (actual time=0.008..0.011 rows=3 loops=3,239)

  • Index Cond: ((cid = 8839) AND (ap_header_id = ah.id))
  • Filter: ((deleted_on IS NULL) AND (property_id = ANY ('{93066,93067,93068}'::integer[])))
14. 16.510 16.510 ↑ 1.0 1 8,255

Index Scan using idx_properties_id on properties p (cost=0.29..2.31 rows=1 width=23) (actual time=0.002..0.002 rows=1 loops=8,255)

  • Index Cond: (id = ad.property_id)
  • Filter: (cid = 8839)
Planning time : 6.703 ms