explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NZOp

Settings
# exclusive inclusive rows x rows loops node
1. 4.966 151.095 ↓ 3.4 2,954 1

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

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

Sort (cost=18,386.37..18,393.09 rows=2,685 width=84) (actual time=145.501..146.129 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.865 143.680 ↓ 1.2 3,239 1

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

4. 4.830 142.815 ↓ 1.2 3,239 1

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

5. 3.996 137.985 ↓ 1.2 3,239 1

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

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

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

7. 8.695 19.689 ↓ 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=11.149..19.689 rows=3,239 loops=1)

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

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

9. 0.890 0.890 ↓ 1.0 7,609 1

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

  • Index Cond: (cid = 8839)
10. 9.887 9.887 ↓ 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.887..9.887 rows=85,889 loops=1)

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

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

  • Group Key: ad.ap_header_id
12. 10.864 80.975 ↓ 3.0 3 3,239

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

13. 45.346 45.346 ↓ 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.010..0.014 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. 24.765 24.765 ↑ 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.003..0.003 rows=1 loops=8,255)

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