explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Gpf4

Settings
# exclusive inclusive rows x rows loops node
1. 2.483 3,392.686 ↑ 1.0 1 1

Aggregate (cost=698.35..698.36 rows=1 width=16) (actual time=3,392.686..3,392.686 rows=1 loops=1)

2. 8.688 3,390.203 ↓ 547.6 19,712 1

Nested Loop Left Join (cost=9.35..698.08 rows=36 width=8) (actual time=1.902..3,390.203 rows=19,712 loops=1)

3. 7.488 3,342.091 ↓ 547.6 19,712 1

Nested Loop (cost=6.70..601.51 rows=36 width=12) (actual time=1.889..3,342.091 rows=19,712 loops=1)

4. 5.579 22.987 ↓ 547.6 19,712 1

Nested Loop (cost=0.43..374.94 rows=36 width=16) (actual time=0.031..22.987 rows=19,712 loops=1)

  • Join Filter: (gh.gl_book_id = gb.id)
  • Rows Removed by Join Filter: 766
5. 17.408 17.408 ↓ 273.8 19,712 1

Index Scan using idx_gl_headers_cid_gl_transaction_type_id_post_month_reference_ on gl_headers gh (cost=0.43..369.83 rows=72 width=20) (actual time=0.023..17.408 rows=19,712 loops=1)

  • Index Cond: ((cid = 15573) AND (gl_transaction_type_id = 1) AND (reference_id IS NULL))
  • Filter: ((is_template IS FALSE) AND (gl_header_status_type_id = ANY ('{5,2,1,3}'::integer[])))
  • Rows Removed by Filter: 986
6. 0.000 0.000 ↑ 4.0 1 19,712

Materialize (cost=0.00..1.12 rows=4 width=8) (actual time=0.000..0.000 rows=1 loops=19,712)

7. 0.007 0.007 ↑ 1.3 3 1

Seq Scan on gl_books gb (cost=0.00..1.10 rows=4 width=8) (actual time=0.005..0.007 rows=3 loops=1)

  • Filter: (cid = 15573)
  • Rows Removed by Filter: 4
8. 59.136 3,311.616 ↑ 1.0 1 19,712

Aggregate (cost=6.26..6.27 rows=1 width=97) (actual time=0.168..0.168 rows=1 loops=19,712)

  • Filter: (sum(CASE WHEN (gd.amount > '0'::numeric) THEN gd.amount ELSE '0'::numeric END) IS NOT NULL)
9. 38.142 3,252.480 ↓ 12.0 12 19,712

Nested Loop (cost=0.83..6.26 rows=1 width=5) (actual time=0.017..0.165 rows=12 loops=19,712)

  • Join Filter: (gd.property_id = p.id)
10. 1,431.284 2,976.512 ↓ 12.0 12 19,712

Nested Loop Semi Join (cost=0.69..3.88 rows=1 width=17) (actual time=0.015..0.151 rows=12 loops=19,712)

  • Join Filter: (gd.property_id = lp.property_id)
  • Rows Removed by Join Filter: 1044
11. 118.272 118.272 ↓ 12.0 12 19,712

Index Scan using idx_gl_details_gl_header_id on gl_details gd (cost=0.43..2.99 rows=1 width=13) (actual time=0.002..0.006 rows=12 loops=19,712)

  • Index Cond: (gh.id = gl_header_id)
  • Filter: ((cid = 15573) AND (gl_transaction_type_id = gh.gl_transaction_type_id))
12. 1,426.956 1,426.956 ↓ 88.0 88 237,826

Function Scan on load_properties lp (cost=0.25..0.88 rows=1 width=8) (actual time=0.000..0.006 rows=88 loops=237,826)

  • Filter: (cid = 15573)
13. 237.826 237.826 ↑ 1.0 1 237,826

Index Scan using idx_properties_id on properties p (cost=0.14..2.37 rows=1 width=8) (actual time=0.001..0.001 rows=1 loops=237,826)

  • Index Cond: (id = lp.property_id)
  • Filter: ((cid = 15573) AND (is_disabled = 0))
14. 0.000 39.424 ↓ 0.0 0 19,712

Limit (cost=2.66..2.66 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=19,712)

15. 19.712 39.424 ↓ 0.0 0 19,712

Sort (cost=2.66..2.66 rows=1 width=8) (actual time=0.002..0.002 rows=0 loops=19,712)

  • Sort Key: fa.id DESC
  • Sort Method: quicksort Memory: 25kB
16. 19.712 19.712 ↓ 0.0 0 19,712

Index Scan using idx_file_associations_cid_gl_header_id on file_associations fa (cost=0.43..2.65 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=19,712)

  • Index Cond: ((gh.cid = cid) AND (gh.id = gl_header_id))
  • Filter: (deleted_by IS NULL)