explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TNuf

Settings
# exclusive inclusive rows x rows loops node
1. 46,996.577 46,996.577 ↓ 28,647.0 28,647 1

CTE Scan on chain (cost=342.43..343.83 rows=1 width=32) (actual time=1.750..46,996.577 rows=28,647 loops=1)

  • Filter: ((ar_inv IS NULL) AND ((ap_type)::text = 'S'::text))
  • Rows Removed by Filter: 604701
2.          

CTE chain

3. 2,616.094 46,477.482 ↓ 2,945.8 633,348 1

Recursive Union (cost=2.29..342.43 rows=215 width=82) (actual time=0.065..46,477.482 rows=633,348 loops=1)

4. 0.004 0.066 ↑ 15.0 1 1

Nested Loop Left Join (cost=2.29..164.75 rows=15 width=36) (actual time=0.062..0.066 rows=1 loops=1)

5. 0.005 0.048 ↑ 15.0 1 1

Nested Loop Left Join (cost=2.21..161.31 rows=15 width=28) (actual time=0.045..0.048 rows=1 loops=1)

6. 0.025 0.025 ↑ 3.0 1 1

Index Scan using idx_btree_apinvdet_doctypeinvoice on apinvdet (cost=0.08..7.03 rows=3 width=28) (actual time=0.024..0.025 rows=1 loops=1)

  • Index Cond: (((doc_type)::text = 'M'::text) AND ((invoice)::text = ' 148981'::text))
7. 0.006 0.018 ↑ 25.0 1 1

Bitmap Heap Scan on inlink (cost=2.12..51.35 rows=25 width=20) (actual time=0.017..0.018 rows=1 loops=1)

  • Recheck Cond: ((apinvdet."timestamp")::text = (vdoc_stamp)::text)
  • Heap Blocks: exact=1
8. 0.012 0.012 ↑ 25.0 1 1

Bitmap Index Scan on idx_btree_inlink_vdocstamp (cost=0.00..2.12 rows=25 width=0) (actual time=0.012..0.012 rows=1 loops=1)

  • Index Cond: ((apinvdet."timestamp")::text = (vdoc_stamp)::text)
9. 0.014 0.014 ↑ 1.0 1 1

Index Scan using idx_btree_arinvdet_timestamp on arinvdet (cost=0.09..0.23 rows=1 width=28) (actual time=0.013..0.014 rows=1 loops=1)

  • Index Cond: ((inlink.cdoc_stamp)::text = ("timestamp")::text)
10. 5,690.265 43,861.322 ↓ 5,336.1 106,721 23

Nested Loop Left Join (cost=0.26..17.64 rows=20 width=82) (actual time=0.046..1,907.014 rows=106,721 loops=23)

11. 2,080.937 16,079.783 ↓ 5,336.1 106,721 23

Nested Loop Left Join (cost=0.17..13.05 rows=20 width=74) (actual time=0.036..699.121 rows=106,721 loops=23)

12. 807.465 6,293.214 ↓ 6,979.8 27,919 23

Nested Loop Left Join (cost=0.08..11.08 rows=4 width=74) (actual time=0.026..273.618 rows=27,919 loops=23)

13. 255.277 255.277 ↓ 17,493.0 17,493 23

WorkTable Scan on chain c (cost=0.00..0.98 rows=1 width=64) (actual time=0.009..11.099 rows=17,493 loops=23)

  • Filter: ((ar_inv IS NOT NULL) AND ((ap_type)::text = 'M'::text))
  • Rows Removed by Filter: 10044
14. 5,230.472 5,230.472 ↑ 4.0 1 402,344

Index Scan using idx_btree_apinvdet_invoice on apinvdet apinvdet_1 (cost=0.08..10.10 rows=4 width=26) (actual time=0.012..0.013 rows=1 loops=402,344)

  • Index Cond: ((invoice)::text = (c.ar_inv)::text)
15. 7,705.632 7,705.632 ↑ 6.2 4 642,136

Index Scan using idx_btree_inlink_vdocstamp on inlink inlink_1 (cost=0.09..0.42 rows=25 width=20) (actual time=0.008..0.012 rows=4 loops=642,136)

  • Index Cond: ((apinvdet_1."timestamp")::text = (vdoc_stamp)::text)
16. 22,091.274 22,091.274 ↑ 1.0 1 2,454,586

Index Scan using idx_btree_arinvdet_timestamp on arinvdet arinvdet_1 (cost=0.09..0.23 rows=1 width=28) (actual time=0.009..0.009 rows=1 loops=2,454,586)

  • Index Cond: ((inlink_1.cdoc_stamp)::text = ("timestamp")::text)
Planning time : 2.151 ms
Execution time : 47,030.143 ms