explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 07Ap

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 1,399.265 ↓ 0.0 0 1

GroupAggregate (cost=14,018.57..14,018.65 rows=1 width=236) (actual time=1,399.264..1,399.265 rows=0 loops=1)

  • Group Key: gd.cid, gd.accrual_gl_account_id, gd.property_id
2.          

CTE load_prop

3. 0.004 2.016 ↑ 1.0 1 1

Nested Loop (cost=0.54..9.31 rows=1 width=34) (actual time=2.014..2.016 rows=1 loops=1)

4. 2.006 2.006 ↑ 1.0 1 1

Function Scan on load_properties lp_set (cost=0.25..1.00 rows=1 width=8) (actual time=2.004..2.006 rows=1 loops=1)

  • Filter: ((is_disabled = 0) AND (is_test = 0))
5. 0.006 0.006 ↑ 1.0 1 1

Index Scan using idx_properties_id on properties p (cost=0.29..8.30 rows=1 width=34) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (id = lp_set.property_id)
  • Filter: (lp_set.cid = cid)
6. 0.008 1,399.262 ↓ 0.0 0 1

Sort (cost=14,009.26..14,009.26 rows=1 width=21) (actual time=1,399.262..1,399.262 rows=0 loops=1)

  • Sort Key: gd.accrual_gl_account_id, gd.property_id
  • Sort Method: quicksort Memory: 25kB
7. 112.603 1,399.254 ↓ 0.0 0 1

Nested Loop (cost=62.19..14,009.25 rows=1 width=21) (actual time=1,399.254..1,399.254 rows=0 loops=1)

8. 259.443 436.454 ↓ 99.1 283,399 1

Nested Loop (cost=61.76..10,460.47 rows=2,861 width=21) (actual time=20.618..436.454 rows=283,399 loops=1)

9. 2.021 2.021 ↑ 1.0 1 1

CTE Scan on load_prop (cost=0.00..0.02 rows=1 width=4) (actual time=2.017..2.021 rows=1 loops=1)

10. 158.152 174.990 ↓ 99.1 283,399 1

Bitmap Heap Scan on gl_details gd (cost=61.76..10,431.84 rows=2,861 width=21) (actual time=18.595..174.990 rows=283,399 loops=1)

  • Recheck Cond: ((cid = 235) AND (property_id = load_prop.property_id))
  • Heap Blocks: exact=11596
11. 16.838 16.838 ↓ 99.1 283,399 1

Bitmap Index Scan on idx_gl_details_cid_property_id (cost=0.00..61.05 rows=2,861 width=0) (actual time=16.837..16.838 rows=283,399 loops=1)

  • Index Cond: ((cid = 235) AND (property_id = load_prop.property_id))
12. 850.197 850.197 ↓ 0.0 0 283,399

Index Scan using idx_gl_headers_id on gl_headers gh (cost=0.43..1.24 rows=1 width=12) (actual time=0.003..0.003 rows=0 loops=283,399)

  • Index Cond: (id = gd.gl_header_id)
  • Filter: ((NOT is_template) AND (cid = 235) AND (gl_book_id = 652) AND (gl_header_status_type_id <> ALL ('{2,4,5,6}'::integer[])))
  • Rows Removed by Filter: 1