explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6ksp

Settings
# exclusive inclusive rows x rows loops node
1. 4,070.070 4,131.357 ↓ 1.0 3,052 1

Nested Loop Left Join (cost=2,191.41..20,760.53 rows=2,937 width=2,281) (actual time=17.004..4,131.357 rows=3,052 loops=1)

2. 2.796 58.235 ↓ 1.0 3,052 1

Hash Left Join (cost=2,191.12..14,533.33 rows=2,937 width=1,964) (actual time=16.561..58.235 rows=3,052 loops=1)

  • Hash Cond: (i.cof_payfrom_location_id = pfl.c_bpartner_location_id)
3. 1.930 49.027 ↓ 1.0 3,052 1

Nested Loop Left Join (cost=1,123.96..13,458.45 rows=2,937 width=1,958) (actual time=10.137..49.027 rows=3,052 loops=1)

4. 1.569 40.993 ↓ 1.0 3,052 1

Nested Loop Left Join (cost=1,123.54..8,901.75 rows=2,937 width=1,948) (actual time=10.135..40.993 rows=3,052 loops=1)

5. 4.473 33.320 ↓ 1.0 3,052 1

Nested Loop (cost=1,123.25..4,936.56 rows=2,937 width=1,932) (actual time=10.131..33.320 rows=3,052 loops=1)

6. 2.851 22.743 ↓ 1.0 3,052 1

Hash Join (cost=1,122.96..3,944.56 rows=2,937 width=1,771) (actual time=10.124..22.743 rows=3,052 loops=1)

  • Hash Cond: (i.c_bpartner_location_id = bpl.c_bpartner_location_id)
7. 1.678 10.232 ↓ 1.0 3,052 1

Nested Loop (cost=55.79..2,869.68 rows=2,937 width=1,651) (actual time=0.452..10.232 rows=3,052 loops=1)

8. 0.007 0.007 ↑ 1.0 1 1

Index Scan using c_bpartner_pkey on c_bpartner b (cost=0.29..2.51 rows=1 width=1,127) (actual time=0.007..0.007 rows=1 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
9. 5.088 8.547 ↓ 1.0 3,052 1

Hash Join (cost=55.51..2,837.80 rows=2,937 width=530) (actual time=0.442..8.547 rows=3,052 loops=1)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
10. 3.150 3.387 ↓ 1.0 3,052 1

Bitmap Heap Scan on c_invoice i (cost=40.78..2,815.21 rows=2,937 width=526) (actual time=0.363..3.387 rows=3,052 loops=1)

  • Recheck Cond: (c_bpartner_id = '5005922'::numeric)
  • Heap Blocks: exact=1497
11. 0.237 0.237 ↓ 1.0 3,052 1

Bitmap Index Scan on c_invoice_documentno_target (cost=0.00..40.05 rows=2,937 width=0) (actual time=0.237..0.237 rows=3,052 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
12. 0.030 0.072 ↑ 1.0 210 1

Hash (cost=12.10..12.10 rows=210 width=10) (actual time=0.072..0.072 rows=210 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
13. 0.042 0.042 ↑ 1.0 210 1

Seq Scan on c_doctype d (cost=0.00..12.10 rows=210 width=10) (actual time=0.002..0.042 rows=210 loops=1)

14. 5.269 9.660 ↑ 1.0 22,363 1

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

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

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

16. 6.104 6.104 ↑ 1.0 1 3,052

Index Scan using c_location_pkey on c_location loc (cost=0.29..0.34 rows=1 width=167) (actual time=0.002..0.002 rows=1 loops=3,052)

  • Index Cond: (c_location_id = bpl.c_location_id)
17. 6.104 6.104 ↓ 0.0 0 3,052

Index Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df (cost=0.29..1.34 rows=1 width=22) (actual time=0.002..0.002 rows=0 loops=3,052)

  • Index Cond: (i.c_invoice_id = c_invoice_id)
18. 6.104 6.104 ↑ 1.0 1 3,052

Index Scan using c_order_pkey on c_order o (cost=0.42..1.55 rows=1 width=16) (actual time=0.002..0.002 rows=1 loops=3,052)

  • Index Cond: (i.c_order_id = c_order_id)
19. 2.842 6.412 ↑ 1.0 22,363 1

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

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

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

21. 3.052 3.052 ↑ 1.0 1 3,052

Index Scan using c_location_pkey on c_location locc (cost=0.29..0.34 rows=1 width=137) (actual time=0.001..0.001 rows=1 loops=3,052)

  • Index Cond: (pfl.c_location_id = c_location_id)
Planning time : 3.054 ms
Execution time : 4,131.969 ms