explain.depesz.com

PostgreSQL's explain analyze made readable

Result: B1HR

Settings
# exclusive inclusive rows x rows loops node
1. 1,105.079 17,460.497 ↑ 3.3 1,423 1

Hash Left Join (cost=4,114.64..36,302.10 rows=4,729 width=1,164) (actual time=17.309..17,460.497 rows=1,423 loops=1)

  • Hash Cond: (bp.c_bp_group_id = bpg.c_bp_group_id)
2. 0.696 16,355.414 ↑ 3.3 1,423 1

Hash Left Join (cost=4,113.50..21,832.69 rows=4,729 width=846) (actual time=16.396..16,355.414 rows=1,423 loops=1)

  • Hash Cond: (t.cof_c_bankoccurrence_id = bo.cof_c_bankoccurrence_id)
3. 0.942 16,354.666 ↑ 3.3 1,423 1

Hash Left Join (cost=4,106.19..21,812.68 rows=4,729 width=813) (actual time=16.342..16,354.666 rows=1,423 loops=1)

  • Hash Cond: (t.cof_c_bankintegration_id = bi.cof_c_bankintegration_id)
4. 2.093 16,353.711 ↑ 3.3 1,423 1

Nested Loop Left Join (cost=4,103.70..21,795.38 rows=4,729 width=786) (actual time=16.326..16,353.711 rows=1,423 loops=1)

  • Join Filter: (t.c_invoice_id = i.c_invoice_id)
5. 3.002 16,348.772 ↑ 3.3 1,423 1

Nested Loop (cost=4,103.28..19,412.53 rows=4,729 width=580) (actual time=16.319..16,348.772 rows=1,423 loops=1)

6. 2.911 41.986 ↑ 1.0 3,052 1

Nested Loop Left Join (cost=4,102.86..10,065.72 rows=3,128 width=532) (actual time=15.864..41.986 rows=3,052 loops=1)

7. 1.175 36.023 ↑ 1.0 3,052 1

Nested Loop (cost=4,102.57..5,878.18 rows=3,128 width=516) (actual time=15.861..36.023 rows=3,052 loops=1)

8. 0.009 0.009 ↑ 1.0 1 1

Index Scan using c_bpartner_pkey on c_bpartner bp (cost=0.29..2.51 rows=1 width=25) (actual time=0.008..0.009 rows=1 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
9. 2.674 34.839 ↑ 1.0 3,052 1

Nested Loop Left Join (cost=4,102.28..5,844.39 rows=3,128 width=497) (actual time=15.851..34.839 rows=3,052 loops=1)

10. 1.076 26.061 ↑ 1.0 3,052 1

Nested Loop (cost=4,101.99..4,669.75 rows=3,128 width=497) (actual time=15.845..26.061 rows=3,052 loops=1)

11. 0.004 0.004 ↑ 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.004..0.004 rows=1 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
  • Heap Fetches: 0
12. 2.677 24.981 ↑ 1.0 3,052 1

Hash Join (cost=4,101.70..4,637.07 rows=3,128 width=497) (actual time=15.841..24.981 rows=3,052 loops=1)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
13. 6.008 22.211 ↑ 1.0 3,052 1

Hash Join (cost=4,086.98..4,613.96 rows=3,128 width=493) (actual time=15.742..22.211 rows=3,052 loops=1)

  • Hash Cond: (loc.c_location_id = bpl.c_location_id)
14. 1.725 1.725 ↑ 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.011..1.725 rows=22,683 loops=1)

  • Heap Fetches: 0
15. 1.811 14.478 ↑ 1.0 3,052 1

Hash (cost=4,047.59..4,047.59 rows=3,128 width=499) (actual time=14.478..14.478 rows=3,052 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 1147kB
16. 2.474 12.667 ↑ 1.0 3,052 1

Hash Join (cost=1,110.53..4,047.59 rows=3,128 width=499) (actual time=8.527..12.667 rows=3,052 loops=1)

  • Hash Cond: (i.c_bpartner_location_id = bpl.c_bpartner_location_id)
17. 1.851 2.189 ↑ 1.0 3,052 1

Bitmap Heap Scan on c_invoice i (cost=43.36..2,972.21 rows=3,128 width=493) (actual time=0.508..2.189 rows=3,052 loops=1)

  • Recheck Cond: (c_bpartner_id = '5005922'::numeric)
  • Heap Blocks: exact=1497
18. 0.338 0.338 ↑ 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.338..0.338 rows=3,052 loops=1)

  • Index Cond: (c_bpartner_id = '5005922'::numeric)
19. 3.561 8.004 ↑ 1.0 22,363 1

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

  • Buckets: 32768 Batches: 1 Memory Usage: 1261kB
20. 4.443 4.443 ↑ 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..4.443 rows=22,363 loops=1)

21. 0.040 0.093 ↑ 1.0 210 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
22. 0.053 0.053 ↑ 1.0 210 1

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

23. 6.104 6.104 ↓ 0.0 0 3,052

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_1 (cost=0.29..0.37 rows=1 width=6) (actual time=0.002..0.002 rows=0 loops=3,052)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Heap Fetches: 0
24. 3.052 3.052 ↓ 0.0 0 3,052

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

  • Index Cond: (c_invoice_id = i.c_invoice_id)
25. 16,303.784 16,303.784 ↓ 0.0 0 3,052

Index Scan using idx_c_invoicepayschedule_c_invoice_id_c_invoicepayschedule_id on c_invoicepayschedule ips (cost=0.42..2.96 rows=3 width=54) (actual time=5.246..5.342 rows=0 loops=3,052)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Filter: (invoiceopen(i.c_invoice_id, c_invoicepayschedule_id) <> '0'::numeric)
  • Rows Removed by Filter: 2
26. 2.846 2.846 ↓ 0.0 0 1,423

Index Scan using idx_cof_titulo_c_invoicepayschedule_id_isvalid on cof_titulo t (cost=0.42..0.49 rows=1 width=218) (actual time=0.002..0.002 rows=0 loops=1,423)

  • Index Cond: ((c_invoicepayschedule_id = ips.c_invoicepayschedule_id) AND (isvalid = 'Y'::bpchar))
27. 0.005 0.013 ↑ 1.0 22 1

Hash (cost=2.22..2.22 rows=22 width=33) (actual time=0.013..0.013 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
28. 0.008 0.008 ↑ 1.0 22 1

Seq Scan on cof_c_bankintegration bi (cost=0.00..2.22 rows=22 width=33) (actual time=0.003..0.008 rows=22 loops=1)

29. 0.026 0.052 ↑ 1.0 147 1

Hash (cost=5.47..5.47 rows=147 width=40) (actual time=0.052..0.052 rows=147 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 19kB
30. 0.026 0.026 ↑ 1.0 147 1

Seq Scan on cof_c_bankoccurrence bo (cost=0.00..5.47 rows=147 width=40) (actual time=0.002..0.026 rows=147 loops=1)

31. 0.002 0.004 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=6) (actual time=0.004..0.004 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
32. 0.002 0.002 ↑ 1.0 6 1

Seq Scan on c_bp_group bpg (cost=0.00..1.06 rows=6 width=6) (actual time=0.002..0.002 rows=6 loops=1)

33.          

SubPlan (forHash Left Join)

34. 0.000 0.000 ↑ 1.0 1 1,423

Result (cost=0.00..0.01 rows=1 width=32) (actual time=0.000..0.000 rows=1 loops=1,423)

Planning time : 3.962 ms
Execution time : 17,461.050 ms