explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PO4b

Settings
# exclusive inclusive rows x rows loops node
1. 8,936.534 8,973.484 ↓ 2.2 7,159 1

Nested Loop (cost=4,097.50..13,605.74 rows=3,316 width=57) (actual time=11.409..8,973.484 rows=7,159 loops=1)

2. 0.527 25.442 ↓ 1.3 2,877 1

Nested Loop (cost=4,097.07..5,540.66 rows=2,183 width=21) (actual time=10.991..25.442 rows=2,877 loops=1)

3. 0.006 0.006 ↑ 1.0 1 1

Index Only Scan using c_bpartner_pkey on c_bpartner bp (cost=0.29..1.41 rows=1 width=6) (actual time=0.006..0.006 rows=1 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
  • Heap Fetches: 0
4. 1.608 24.909 ↓ 1.3 2,877 1

Nested Loop Left Join (cost=4,096.79..5,517.42 rows=2,183 width=21) (actual time=10.984..24.909 rows=2,877 loops=1)

5. 0.498 17.547 ↓ 1.3 2,877 1

Nested Loop (cost=4,096.50..4,642.82 rows=2,183 width=21) (actual time=10.978..17.547 rows=2,877 loops=1)

6. 0.002 0.002 ↑ 1.0 1 1

Index Only Scan using c_bpartner_pkey on c_bpartner b (cost=0.29..1.41 rows=1 width=6) (actual time=0.002..0.002 rows=1 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
  • Heap Fetches: 0
7. 1.897 17.047 ↓ 1.3 2,877 1

Hash Join (cost=4,096.21..4,619.59 rows=2,183 width=21) (actual time=10.976..17.047 rows=2,877 loops=1)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
8. 3.490 15.106 ↓ 1.3 2,877 1

Hash Join (cost=4,088.09..4,605.62 rows=2,183 width=21) (actual time=10.928..15.106 rows=2,877 loops=1)

  • Hash Cond: (loc.c_location_id = bpl.c_location_id)
9. 1.620 1.620 ↑ 1.0 22,683 1

Index Only Scan using c_location_pkey on c_location loc (cost=0.29..410.93 rows=22,683 width=6) (actual time=0.007..1.620 rows=22,683 loops=1)

  • Heap Fetches: 0
10. 0.403 9.996 ↓ 1.3 2,877 1

Hash (cost=4,060.51..4,060.51 rows=2,183 width=27) (actual time=9.996..9.996 rows=2,877 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 210kB
11. 0.661 9.593 ↓ 1.3 2,877 1

Hash Join (cost=1,110.29..4,060.51 rows=2,183 width=27) (actual time=6.661..9.593 rows=2,877 loops=1)

  • Hash Cond: (i.c_bpartner_location_id = bpl.c_bpartner_location_id)
12. 2.407 2.638 ↓ 1.3 2,877 1

Bitmap Heap Scan on c_invoice i (cost=43.13..2,987.62 rows=2,183 width=39) (actual time=0.356..2.638 rows=2,877 loops=1)

  • Recheck Cond: (c_bpartner_id = '5005922'::numeric)
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ispayschedulevalid = 'Y'::bpchar))
  • Rows Removed by Filter: 175
  • Heap Blocks: exact=1497
13. 0.231 0.231 ↑ 1.0 3,052 1

Bitmap Index Scan on c_invoice_documentno_target (cost=0.00..42.58 rows=3,128 width=0) (actual time=0.231..0.231 rows=3,052 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
14. 2.776 6.294 ↑ 1.0 22,363 1

Hash (cost=787.63..787.63 rows=22,363 width=12) (actual time=6.294..6.294 rows=22,363 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1261kB
15. 3.518 3.518 ↑ 1.0 22,363 1

Seq Scan on c_bpartner_location bpl (cost=0.00..787.63 rows=22,363 width=12) (actual time=0.002..3.518 rows=22,363 loops=1)

16. 0.026 0.044 ↑ 1.0 210 1

Hash (cost=5.49..5.49 rows=210 width=6) (actual time=0.044..0.044 rows=210 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
17. 0.018 0.018 ↑ 1.0 210 1

Index Only Scan using c_doctype_pkey on c_doctype d (cost=0.14..5.49 rows=210 width=6) (actual time=0.005..0.018 rows=210 loops=1)

  • Heap Fetches: 0
18. 5.754 5.754 ↓ 0.0 0 2,877

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df (cost=0.29..0.39 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=2,877)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Heap Fetches: 0
19. 11.508 11.508 ↑ 1.5 2 2,877

Index Scan using idx_c_invoicepayschedule_c_invoice_id_c_invoicepayschedule_id on c_invoicepayschedule ips (cost=0.42..2.52 rows=3 width=20) (actual time=0.003..0.004 rows=2 loops=2,877)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Filter: (isvalid = 'Y'::bpchar)
Planning time : 1.493 ms
Execution time : 8,974.416 ms