explain.depesz.com

PostgreSQL's explain analyze made readable

Result: V9iz

Settings
# exclusive inclusive rows x rows loops node
1. 0.026 5,308.192 ↓ 2.1 19 1

HashAggregate (cost=52,291.31..52,291.40 rows=9 width=464) (actual time=5,308.189..5,308.192 rows=19 loops=1)

  • Group Key: ('04'::text), ('PAGAR'::text), oi.documentno, (currencyconvert(oi.openamt, oi.c_currency_id, '297'::numeric, '2018-12-06 00:00:00-02'::timestamp with time zone, oi.c_conversiontype_id, oi.ad_client_id, oi.ad_org_id)), bp.name, oi.ad_org_id, oi.ad_client_id
2. 0.003 5,308.166 ↓ 2.1 19 1

Append (cost=33,315.26..52,291.15 rows=9 width=464) (actual time=5,121.197..5,308.166 rows=19 loops=1)

3. 0.021 5,121.967 ↓ 5.0 15 1

Nested Loop Left Join (cost=33,315.26..33,483.25 rows=3 width=239) (actual time=5,121.196..5,121.967 rows=15 loops=1)

4. 0.010 5,121.916 ↓ 5.0 15 1

Hash Left Join (cost=33,314.98..33,478.13 rows=3 width=190) (actual time=5,121.186..5,121.916 rows=15 loops=1)

  • Hash Cond: (oi.cof_titulo_id = t.cof_titulo_id)
  • Filter: ((t.cof_billfoldtype IS NULL) OR ((t.cof_billfoldtype)::text = 'CS'::text))
5. 0.058 5,121.889 ↑ 2.4 15 1

Subquery Scan on oi (cost=33,312.64..33,475.70 rows=36 width=206) (actual time=5,121.163..5,121.889 rows=15 loops=1)

  • Filter: (oi.duedate = '2018-12-20'::date)
  • Rows Removed by Filter: 728
6. 5.186 5,121.831 ↑ 9.8 743 1

HashAggregate (cost=33,312.64..33,385.11 rows=7,247 width=3,648) (actual time=5,121.082..5,121.831 rows=743 loops=1)

  • Group Key: "*SELECT* 1".ad_org_id, "*SELECT* 1".ad_client_id, "*SELECT* 1".documentno, "*SELECT* 1".c_invoice_id, "*SELECT* 1".c_order_id, "*SELECT* 1".c_bpartner_id, "*SELECT* 1".issotrx, "*SELECT* 1".dateinvoiced, "*SELECT* 1".dateacct, "*SELECT* 1".netdays, "*SELECT* 1".duedate, "*SELECT* 1".daysdue, (("*SELECT* 1".discountdate)::timestamp without time zone), "*SELECT* 1".discountamt, "*SELECT* 1".grandtotal, "*SELECT* 1".paidamt, "*SELECT* 1".openamt, "*SELECT* 1".c_currency_id, "*SELECT* 1".c_conversiontype_id, "*SELECT* 1".c_paymentterm_id, "*SELECT* 1".ispayschedulevalid, (NULL::numeric), "*SELECT* 1".invoicecollectiontype, "*SELECT* 1".c_campaign_id, "*SELECT* 1".c_project_id, "*SELECT* 1".c_activity_id, "*SELECT* 1".ad_orgtrx_id, "*SELECT* 1".ad_user_id, "*SELECT* 1".c_bpartner_location_id, "*SELECT* 1".c_charge_id, "*SELECT* 1".c_doctype_id, "*SELECT* 1".c_doctypetarget_id, "*SELECT* 1".c_dunninglevel_id, "*SELECT* 1".chargeamt, "*SELECT* 1".c_payment_id, "*SELECT* 1".created, "*SELECT* 1".createdby, "*SELECT* 1".dateordered, "*SELECT* 1".dateprinted, "*SELECT* 1".description, "*SELECT* 1".docaction, "*SELECT* 1".docstatus, "*SELECT* 1".dunninggrace, "*SELECT* 1".generateto, "*SELECT* 1".isactive, "*SELECT* 1".isapproved, "*SELECT* 1".isdiscountprinted, "*SELECT* 1".isindispute, "*SELECT* 1".ispaid, "*SELECT* 1".isprinted, "*SELECT* 1".isselfservice, "*SELECT* 1".istaxincluded, "*SELECT* 1".istransferred, "*SELECT* 1".m_pricelist_id, "*SELECT* 1".m_rma_id, "*SELECT* 1".paymentrule, "*SELECT* 1".poreference, "*SELECT* 1".posted, "*SELECT* 1".processedon, "*SELECT* 1".processing, "*SELECT* 1".ref_invoice_id, "*SELECT* 1".reversal_id, "*SELECT* 1".salesrep_id, "*SELECT* 1".sendemail, "*SELECT* 1".totallines, "*SELECT* 1".updated, "*SELECT* 1".updatedby, "*SELECT* 1".user1_id, "*SELECT* 1".user2_id, "*SELECT* 1".ide_nnf, "*SELECT* 1".lbr_nfestatus, "*SELECT* 1".ide_serie, "*SELECT* 1".ide_tpnf, "*SELECT* 1".cof_processed, "*SELECT* 1".cof_processed2, "*SELECT* 1".cof_borderoname, "*SELECT* 1".cof_titulo_nossonumero, "*SELECT* 1".cof_bankintegrationname, "*SELECT* 1".cof_occurrencevalue, "*SELECT* 1".cof_occurrencename, "*SELECT* 1".cof_titulo_id, "*SELECT* 1".cof_recordhistory, "*SELECT* 1".lbr_transactiontype, "*SELECT* 1".infnfe_id, "*SELECT* 1".lbr_nfentrada, "*SELECT* 1".cof_serienfentrada, "*SELECT* 1".lbr_nfmodel, "*SELECT* 1".cof_otheramt, "*SELECT* 1".cof_insuranceamt, "*SELECT* 1".cof_modfrete, "*SELECT* 1".cof_sourceinvoice_id, "*SELECT* 1".cof_composescashflow, "*SELECT* 1".cof_payfrom_location_id, "*SELECT* 1".cof_orgst_id, "*SELECT* 1".cof_isindustrialization, "*SELECT* 1".lbr_docfiscal_id, "*SELECT* 1".cof_qtycheck, "*SELECT* 1".c_bp_group_id, "*SELECT* 1".cof_c_custody_id, "*SELECT* 1".bpartner_value, "*SELECT* 1".cof_c_planofinanceiro_id, "*SELECT* 1".cof_openamtconverted, "*SELECT* 1".cof_grandtotalconverted, "*SELECT* 1".cof_exibiremrelatorios, "*SELECT* 1".rv_openitem_id, (NULL::character varying), "*SELECT* 1".cof_c_bankintegration_id, "*SELECT* 1".cof_c_bankoccurrence_id, (NULL::timestamp without time zone), ('N'::text), "*SELECT* 1".cof_titulo_numdoc, "*SELECT* 1".cof_checkallocateamt
7. 0.138 5,116.645 ↑ 9.8 743 1

Append (cost=316.23..31,283.48 rows=7,247 width=3,648) (actual time=34.569..5,116.645 rows=743 loops=1)

8. 0.002 37.314 ↑ 103.0 2 1

Subquery Scan on *SELECT* 1 (cost=316.23..4,357.40 rows=206 width=2,259) (actual time=34.568..37.314 rows=2 loops=1)

9. 5.061 37.312 ↑ 103.0 2 1

Hash Left Join (cost=316.23..4,354.82 rows=206 width=2,255) (actual time=34.567..37.312 rows=2 loops=1)

  • Hash Cond: (bp_1.c_bp_group_id = bpg.c_bp_group_id)
10. 0.007 32.242 ↑ 103.0 2 1

Nested Loop Left Join (cost=315.07..3,779.61 rows=206 width=1,907) (actual time=30.498..32.242 rows=2 loops=1)

11. 0.009 32.223 ↑ 103.0 2 1

Hash Join (cost=314.79..3,555.08 rows=206 width=1,891) (actual time=30.492..32.223 rows=2 loops=1)

  • Hash Cond: (i.c_paymentterm_id = p.c_paymentterm_id)
12. 0.007 32.185 ↑ 103.0 2 1

Hash Left Join (cost=311.60..3,551.30 rows=206 width=1,882) (actual time=30.455..32.185 rows=2 loops=1)

  • Hash Cond: (i.c_invoice_id = t_1.c_invoice_id)
13. 0.020 31.972 ↑ 103.0 2 1

Hash Left Join (cost=306.76..3,545.68 rows=206 width=666) (actual time=30.244..31.972 rows=2 loops=1)

  • Hash Cond: (i.c_bpartner_id = bp_1.c_bpartner_id)
14. 0.474 31.432 ↑ 103.0 2 1

Nested Loop Left Join (cost=192.12..3,428.44 rows=206 width=6,327) (actual time=29.706..31.432 rows=2 loops=1)

15. 0.004 30.944 ↑ 103.0 2 1

Nested Loop (cost=191.84..3,063.36 rows=206 width=544) (actual time=29.443..30.944 rows=2 loops=1)

16. 0.009 30.822 ↑ 103.0 2 1

Hash Join (cost=191.56..2,996.29 rows=206 width=551) (actual time=29.329..30.822 rows=2 loops=1)

  • Hash Cond: (i.c_bpartner_location_id = bpl.c_bpartner_location_id)
17. 0.006 30.339 ↑ 103.0 2 1

Hash Join (cost=126.39..2,930.58 rows=206 width=544) (actual time=28.848..30.339 rows=2 loops=1)

  • Hash Cond: (i.c_bpartner_id = b.c_bpartner_id)
18. 0.008 29.913 ↑ 103.0 2 1

Hash Join (cost=11.75..2,815.40 rows=206 width=544) (actual time=28.425..29.913 rows=2 loops=1)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
19. 29.853 29.853 ↑ 103.0 2 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i (cost=0.29..2,803.38 rows=206 width=540) (actual time=28.367..29.853 rows=2 loops=1)

  • Index Cond: ((ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric))
  • Filter: ((ispayschedulevalid <> 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL}'::bpchar[])) AND (issotrx = 'N'::bpchar) AND (cof_composescashflow = 'Y'::bpchar) AND (invoiceopen(c_invoice_id, '0'::numeric) <> '0'::numeric))
  • Rows Removed by Filter: 7278
20. 0.025 0.052 ↑ 1.0 154 1

Hash (cost=9.54..9.54 rows=154 width=10) (actual time=0.052..0.052 rows=154 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
21. 0.027 0.027 ↑ 1.0 154 1

Seq Scan on c_doctype d (cost=0.00..9.54 rows=154 width=10) (actual time=0.002..0.027 rows=154 loops=1)

22. 0.188 0.420 ↓ 1.0 1,413 1

Hash (cost=97.06..97.06 rows=1,406 width=6) (actual time=0.420..0.420 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
23. 0.232 0.232 ↓ 1.0 1,413 1

Seq Scan on c_bpartner b (cost=0.00..97.06 rows=1,406 width=6) (actual time=0.008..0.232 rows=1,413 loops=1)

24. 0.224 0.474 ↓ 1.0 1,442 1

Hash (cost=47.30..47.30 rows=1,430 width=13) (actual time=0.474..0.474 rows=1,442 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 81kB
25. 0.250 0.250 ↓ 1.0 1,442 1

Seq Scan on c_bpartner_location bpl (cost=0.00..47.30 rows=1,430 width=13) (actual time=0.003..0.250 rows=1,442 loops=1)

26. 0.118 0.118 ↑ 1.0 1 2

Index Only Scan using c_location_pkey on c_location loc (cost=0.29..0.33 rows=1 width=6) (actual time=0.059..0.059 rows=1 loops=2)

  • Index Cond: (c_location_id = bpl.c_location_id)
  • Heap Fetches: 0
27. 0.014 0.014 ↓ 0.0 0 2

Index Only Scan using cof_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_1 (cost=0.28..0.49 rows=1 width=7) (actual time=0.007..0.007 rows=0 loops=2)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Heap Fetches: 0
28. 0.240 0.520 ↓ 1.0 1,413 1

Hash (cost=97.06..97.06 rows=1,406 width=19) (actual time=0.520..0.520 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 90kB
29. 0.280 0.280 ↓ 1.0 1,413 1

Seq Scan on c_bpartner bp_1 (cost=0.00..97.06 rows=1,406 width=19) (actual time=0.003..0.280 rows=1,413 loops=1)

30. 0.000 0.206 ↓ 0.0 0 1

Hash (cost=4.83..4.83 rows=1 width=1,232) (actual time=0.206..0.206 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
31. 0.000 0.206 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.24..4.83 rows=1 width=1,232) (actual time=0.206..0.206 rows=0 loops=1)

  • Join Filter: (bi.cof_c_bankintegration_id = t_1.cof_c_bankintegration_id)
32. 0.002 0.206 ↓ 0.0 0 1

Hash Right Join (cost=2.24..3.78 rows=1 width=1,094) (actual time=0.206..0.206 rows=0 loops=1)

  • Hash Cond: (bo.cof_c_bankoccurrence_id = t_1.cof_c_bankoccurrence_id)
33. 0.000 0.000 ↓ 0.0 0

Seq Scan on cof_c_bankoccurrence bo (cost=0.00..1.39 rows=39 width=252) (never executed)

34. 0.000 0.204 ↓ 0.0 0 1

Hash (cost=2.23..2.23 rows=1 width=858) (actual time=0.204..0.204 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
35. 0.204 0.204 ↓ 0.0 0 1

Seq Scan on cof_titulo t_1 (cost=0.00..2.23 rows=1 width=858) (actual time=0.204..0.204 rows=0 loops=1)

  • Filter: ((COALESCE(c_invoicepayschedule_id, '0'::numeric) = '0'::numeric) AND (isvalid = 'Y'::bpchar))
  • Rows Removed by Filter: 15
36. 0.000 0.000 ↓ 0.0 0

Seq Scan on cof_c_bankintegration bi (cost=0.00..1.02 rows=2 width=154) (never executed)

37. 0.014 0.029 ↑ 1.0 53 1

Hash (cost=2.53..2.53 rows=53 width=15) (actual time=0.029..0.029 rows=53 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
38. 0.015 0.015 ↑ 1.0 53 1

Seq Scan on c_paymentterm p (cost=0.00..2.53 rows=53 width=15) (actual time=0.005..0.015 rows=53 loops=1)

39. 0.012 0.012 ↓ 0.0 0 2

Index Scan using cof_lbr_docfiscal_c_invoice_id on lbr_docfiscal df (cost=0.28..1.08 rows=1 width=23) (actual time=0.006..0.006 rows=0 loops=2)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
40. 0.002 0.009 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=16) (actual time=0.009..0.009 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
41. 0.007 0.007 ↑ 1.0 7 1

Seq Scan on c_bp_group bpg (cost=0.00..1.07 rows=7 width=16) (actual time=0.006..0.007 rows=7 loops=1)

42. 0.939 5,079.193 ↑ 9.5 741 1

Subquery Scan on *SELECT* 2 (cost=6,525.82..26,926.08 rows=7,041 width=2,189) (actual time=1,679.179..5,079.193 rows=741 loops=1)

43. 977.660 5,078.254 ↑ 9.5 741 1

Hash Left Join (cost=6,525.82..26,820.47 rows=7,041 width=2,161) (actual time=1,679.176..5,078.254 rows=741 loops=1)

  • Hash Cond: ((i_1.c_invoice_id = t_2.c_invoice_id) AND (ips.c_invoicepayschedule_id = t_2.c_invoicepayschedule_id))
44. 2,421.142 4,100.271 ↑ 9.5 741 1

Hash Join (cost=6,521.01..8,878.70 rows=7,041 width=676) (actual time=1,677.890..4,100.271 rows=741 loops=1)

  • Hash Cond: (ips.c_invoice_id = i_1.c_invoice_id)
  • Join Filter: (invoiceopen(i_1.c_invoice_id, ips.c_invoicepayschedule_id) <> '0'::numeric)
  • Rows Removed by Join Filter: 7079
45. 4.417 4.417 ↓ 1.0 12,011 1

Seq Scan on c_invoicepayschedule ips (cost=0.00..455.48 rows=11,937 width=54) (actual time=0.003..4.417 rows=12,011 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 23
46. 8.910 1,674.712 ↓ 1.1 6,166 1

Hash (cost=6,449.99..6,449.99 rows=5,682 width=628) (actual time=1,674.712..1,674.712 rows=6,166 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2382kB
47. 3.652 1,665.802 ↓ 1.1 6,166 1

Hash Left Join (cost=871.54..6,449.99 rows=5,682 width=628) (actual time=5.947..1,665.802 rows=6,166 loops=1)

  • Hash Cond: (bp_2.c_bp_group_id = bpg_1.c_bp_group_id)
48. 4.863 1,662.144 ↓ 1.1 6,166 1

Hash Left Join (cost=870.38..6,424.88 rows=5,682 width=618) (actual time=5.938..1,662.144 rows=6,166 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = bp_2.c_bpartner_id)
49. 4.744 1,656.745 ↓ 1.1 6,166 1

Hash Left Join (cost=755.74..6,295.29 rows=5,682 width=605) (actual time=5.397..1,656.745 rows=6,166 loops=1)

  • Hash Cond: (i_1.c_invoice_id = df_2.c_invoice_id)
50. 1,626.476 1,650.946 ↓ 1.1 6,166 1

Hash Left Join (cost=503.93..5,954.32 rows=5,682 width=6,327) (actual time=4.337..1,650.946 rows=6,166 loops=1)

  • Hash Cond: (i_1.c_invoice_id = df_3.c_invoice_id)
51. 3.766 24.159 ↓ 1.1 6,166 1

Hash Join (cost=418.28..1,494.37 rows=5,682 width=538) (actual time=3.098..24.159 rows=6,166 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = b_1.c_bpartner_id)
52. 3.147 19.977 ↓ 1.1 6,166 1

Hash Join (cost=303.64..1,364.77 rows=5,682 width=538) (actual time=2.678..19.977 rows=6,166 loops=1)

  • Hash Cond: (i_1.c_doctype_id = d_1.c_doctype_id)
53. 4.818 16.778 ↓ 1.1 6,166 1

Hash Join (cost=292.18..1,337.98 rows=5,682 width=534) (actual time=2.621..16.778 rows=6,166 loops=1)

  • Hash Cond: (i_1.c_bpartner_location_id = bpl_1.c_bpartner_location_id)
54. 9.368 9.368 ↓ 1.1 6,166 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i_1 (cost=0.29..967.96 rows=5,682 width=534) (actual time=0.026..9.368 rows=6,166 loops=1)

  • Index Cond: ((ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ispayschedulevalid = 'Y'::bpchar) AND (cof_composescashflow = 'Y'::bpchar) AND (issotrx = 'N'::bpchar))
  • Rows Removed by Filter: 1114
55. 0.208 2.592 ↓ 1.0 1,442 1

Hash (cost=274.02..274.02 rows=1,430 width=6) (actual time=2.592..2.592 rows=1,442 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 71kB
56. 1.307 2.384 ↓ 1.0 1,442 1

Merge Join (cost=0.98..274.02 rows=1,430 width=6) (actual time=0.015..2.384 rows=1,442 loops=1)

  • Merge Cond: (bpl_1.c_location_id = loc_1.c_location_id)
57. 0.295 0.295 ↓ 1.0 1,442 1

Index Scan using idx_c_bpartner_location_c_location_id on c_bpartner_location bpl_1 (cost=0.28..63.04 rows=1,430 width=13) (actual time=0.005..0.295 rows=1,442 loops=1)

58. 0.782 0.782 ↓ 1.0 10,094 1

Index Only Scan using c_location_pkey on c_location loc_1 (cost=0.29..180.81 rows=9,835 width=6) (actual time=0.008..0.782 rows=10,094 loops=1)

  • Heap Fetches: 187
59. 0.024 0.052 ↑ 1.0 154 1

Hash (cost=9.54..9.54 rows=154 width=10) (actual time=0.052..0.052 rows=154 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
60. 0.028 0.028 ↑ 1.0 154 1

Seq Scan on c_doctype d_1 (cost=0.00..9.54 rows=154 width=10) (actual time=0.002..0.028 rows=154 loops=1)

61. 0.202 0.416 ↓ 1.0 1,413 1

Hash (cost=97.06..97.06 rows=1,406 width=6) (actual time=0.416..0.416 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
62. 0.214 0.214 ↓ 1.0 1,413 1

Seq Scan on c_bpartner b_1 (cost=0.00..97.06 rows=1,406 width=6) (actual time=0.003..0.214 rows=1,413 loops=1)

63. 0.147 0.311 ↑ 1.0 1,102 1

Hash (cost=71.86..71.86 rows=1,103 width=7) (actual time=0.311..0.311 rows=1,102 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 58kB
64. 0.164 0.164 ↑ 1.0 1,103 1

Index Only Scan using cof_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_3 (cost=0.28..71.86 rows=1,103 width=7) (actual time=0.008..0.164 rows=1,103 loops=1)

  • Heap Fetches: 219
65. 0.199 1.055 ↑ 1.0 1,102 1

Hash (cost=238.03..238.03 rows=1,103 width=23) (actual time=1.055..1.055 rows=1,102 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 73kB
66. 0.856 0.856 ↑ 1.0 1,103 1

Seq Scan on lbr_docfiscal df_2 (cost=0.00..238.03 rows=1,103 width=23) (actual time=0.004..0.856 rows=1,103 loops=1)

67. 0.235 0.536 ↓ 1.0 1,413 1

Hash (cost=97.06..97.06 rows=1,406 width=19) (actual time=0.536..0.536 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 90kB
68. 0.301 0.301 ↓ 1.0 1,413 1

Seq Scan on c_bpartner bp_2 (cost=0.00..97.06 rows=1,406 width=19) (actual time=0.003..0.301 rows=1,413 loops=1)

69. 0.003 0.006 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=16) (actual time=0.006..0.006 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
70. 0.003 0.003 ↑ 1.0 7 1

Seq Scan on c_bp_group bpg_1 (cost=0.00..1.07 rows=7 width=16) (actual time=0.002..0.003 rows=7 loops=1)

71. 0.004 0.323 ↓ 11.0 11 1

Hash (cost=4.79..4.79 rows=1 width=1,248) (actual time=0.323..0.323 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
72. 0.010 0.319 ↓ 11.0 11 1

Nested Loop Left Join (cost=2.20..4.79 rows=1 width=1,248) (actual time=0.308..0.319 rows=11 loops=1)

  • Join Filter: (bi_1.cof_c_bankintegration_id = t_2.cof_c_bankintegration_id)
  • Rows Removed by Join Filter: 1
73. 0.010 0.177 ↓ 11.0 11 1

Hash Right Join (cost=2.20..3.75 rows=1 width=1,110) (actual time=0.174..0.177 rows=11 loops=1)

  • Hash Cond: (bo_1.cof_c_bankoccurrence_id = t_2.cof_c_bankoccurrence_id)
74. 0.151 0.151 ↑ 1.0 39 1

Seq Scan on cof_c_bankoccurrence bo_1 (cost=0.00..1.39 rows=39 width=252) (actual time=0.150..0.151 rows=39 loops=1)

75. 0.003 0.016 ↓ 11.0 11 1

Hash (cost=2.19..2.19 rows=1 width=874) (actual time=0.016..0.016 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
76. 0.013 0.013 ↓ 11.0 11 1

Seq Scan on cof_titulo t_2 (cost=0.00..2.19 rows=1 width=874) (actual time=0.005..0.013 rows=11 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 4
77. 0.132 0.132 ↑ 2.0 1 11

Seq Scan on cof_c_bankintegration bi_1 (cost=0.00..1.02 rows=2 width=154) (actual time=0.012..0.012 rows=1 loops=11)

78.          

SubPlan (forHash Left Join)

79. 0.000 0.000 ↑ 1.0 1 741

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

80. 0.004 0.017 ↑ 1.0 15 1

Hash (cost=2.15..2.15 rows=15 width=28) (actual time=0.017..0.017 rows=15 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
81. 0.013 0.013 ↑ 1.0 15 1

Seq Scan on cof_titulo t (cost=0.00..2.15 rows=15 width=28) (actual time=0.004..0.013 rows=15 loops=1)

82. 0.030 0.030 ↑ 1.0 1 15

Index Scan using c_bpartner_pkey on c_bpartner bp (cost=0.28..1.46 rows=1 width=39) (actual time=0.002..0.002 rows=1 loops=15)

  • Index Cond: (c_bpartner_id = oi.c_bpartner_id)
83. 0.001 169.362 ↓ 0.0 0 1

Nested Loop Left Join (cost=8,725.93..8,746.68 rows=1 width=239) (actual time=169.362..169.362 rows=0 loops=1)

84. 0.014 169.361 ↓ 0.0 0 1

Hash Left Join (cost=8,725.66..8,746.02 rows=1 width=190) (actual time=169.361..169.361 rows=0 loops=1)

  • Hash Cond: ("*SELECT* 1_1".cof_c_custody_id = cu.cof_c_custody_id)
  • Filter: (CASE WHEN (bai.t_integer IS NOT NULL) THEN ("*SELECT* 1_1".duedate + ('1 day'::interval * ((bai.t_integer + cu.cof_diasadeslocar))::double precision)) ELSE ("*SELECT* 1_1".duedate + ('1 day'::interval * (cu.cof_diasadeslocar)::double precision)) END = '2018-12-20'::date)
  • Rows Removed by Filter: 25
85. 0.005 169.327 ↑ 2.5 25 1

Hash Left Join (cost=8,724.43..8,744.63 rows=63 width=230) (actual time=169.293..169.327 rows=25 loops=1)

  • Hash Cond: (t_3.cof_c_bankintegration_id = bai.cof_c_bankintegration_id)
86. 0.007 169.318 ↑ 2.5 25 1

Hash Left Join (cost=8,723.39..8,743.37 rows=63 width=230) (actual time=169.287..169.318 rows=25 loops=1)

  • Hash Cond: ("*SELECT* 1_1".cof_titulo_id = t_3.cof_titulo_id)
  • Filter: ((t_3.cof_billfoldtype IS NULL) OR ((t_3.cof_billfoldtype)::text = 'CS'::text))
87. 0.189 169.291 ↑ 35.2 25 1

HashAggregate (cost=8,721.19..8,730.00 rows=881 width=3,648) (actual time=169.263..169.291 rows=25 loops=1)

  • Group Key: "*SELECT* 1_1".ad_org_id, "*SELECT* 1_1".ad_client_id, "*SELECT* 1_1".documentno, "*SELECT* 1_1".c_invoice_id, "*SELECT* 1_1".c_order_id, "*SELECT* 1_1".c_bpartner_id, "*SELECT* 1_1".issotrx, "*SELECT* 1_1".dateinvoiced, "*SELECT* 1_1".dateacct, "*SELECT* 1_1".netdays, "*SELECT* 1_1".duedate, "*SELECT* 1_1".daysdue, (("*SELECT* 1_1".discountdate)::timestamp without time zone), "*SELECT* 1_1".discountamt, "*SELECT* 1_1".grandtotal, "*SELECT* 1_1".paidamt, "*SELECT* 1_1".openamt, "*SELECT* 1_1".c_currency_id, "*SELECT* 1_1".c_conversiontype_id, "*SELECT* 1_1".c_paymentterm_id, "*SELECT* 1_1".ispayschedulevalid, (NULL::numeric), "*SELECT* 1_1".invoicecollectiontype, "*SELECT* 1_1".c_campaign_id, "*SELECT* 1_1".c_project_id, "*SELECT* 1_1".c_activity_id, "*SELECT* 1_1".ad_orgtrx_id, "*SELECT* 1_1".ad_user_id, "*SELECT* 1_1".c_bpartner_location_id, "*SELECT* 1_1".c_charge_id, "*SELECT* 1_1".c_doctype_id, "*SELECT* 1_1".c_doctypetarget_id, "*SELECT* 1_1".c_dunninglevel_id, "*SELECT* 1_1".chargeamt, "*SELECT* 1_1".c_payment_id, "*SELECT* 1_1".created, "*SELECT* 1_1".createdby, "*SELECT* 1_1".dateordered, "*SELECT* 1_1".dateprinted, "*SELECT* 1_1".description, "*SELECT* 1_1".docaction, "*SELECT* 1_1".docstatus, "*SELECT* 1_1".dunninggrace, "*SELECT* 1_1".generateto, "*SELECT* 1_1".isactive, "*SELECT* 1_1".isapproved, "*SELECT* 1_1".isdiscountprinted, "*SELECT* 1_1".isindispute, "*SELECT* 1_1".ispaid, "*SELECT* 1_1".isprinted, "*SELECT* 1_1".isselfservice, "*SELECT* 1_1".istaxincluded, "*SELECT* 1_1".istransferred, "*SELECT* 1_1".m_pricelist_id, "*SELECT* 1_1".m_rma_id, "*SELECT* 1_1".paymentrule, "*SELECT* 1_1".poreference, "*SELECT* 1_1".posted, "*SELECT* 1_1".processedon, "*SELECT* 1_1".processing, "*SELECT* 1_1".ref_invoice_id, "*SELECT* 1_1".reversal_id, "*SELECT* 1_1".salesrep_id, "*SELECT* 1_1".sendemail, "*SELECT* 1_1".totallines, "*SELECT* 1_1".updated, "*SELECT* 1_1".updatedby, "*SELECT* 1_1".user1_id, "*SELECT* 1_1".user2_id, "*SELECT* 1_1".ide_nnf, "*SELECT* 1_1".lbr_nfestatus, "*SELECT* 1_1".ide_serie, "*SELECT* 1_1".ide_tpnf, "*SELECT* 1_1".cof_processed, "*SELECT* 1_1".cof_processed2, "*SELECT* 1_1".cof_borderoname, "*SELECT* 1_1".cof_titulo_nossonumero, "*SELECT* 1_1".cof_bankintegrationname, "*SELECT* 1_1".cof_occurrencevalue, "*SELECT* 1_1".cof_occurrencename, "*SELECT* 1_1".cof_titulo_id, "*SELECT* 1_1".cof_recordhistory, "*SELECT* 1_1".lbr_transactiontype, "*SELECT* 1_1".infnfe_id, "*SELECT* 1_1".lbr_nfentrada, "*SELECT* 1_1".cof_serienfentrada, "*SELECT* 1_1".lbr_nfmodel, "*SELECT* 1_1".cof_otheramt, "*SELECT* 1_1".cof_insuranceamt, "*SELECT* 1_1".cof_modfrete, "*SELECT* 1_1".cof_sourceinvoice_id, "*SELECT* 1_1".cof_composescashflow, "*SELECT* 1_1".cof_payfrom_location_id, "*SELECT* 1_1".cof_orgst_id, "*SELECT* 1_1".cof_isindustrialization, "*SELECT* 1_1".lbr_docfiscal_id, "*SELECT* 1_1".cof_qtycheck, "*SELECT* 1_1".c_bp_group_id, "*SELECT* 1_1".cof_c_custody_id, "*SELECT* 1_1".bpartner_value, "*SELECT* 1_1".cof_c_planofinanceiro_id, "*SELECT* 1_1".cof_openamtconverted, "*SELECT* 1_1".cof_grandtotalconverted, "*SELECT* 1_1".cof_exibiremrelatorios, "*SELECT* 1_1".rv_openitem_id, (NULL::character varying), "*SELECT* 1_1".cof_c_bankintegration_id, "*SELECT* 1_1".cof_c_bankoccurrence_id, (NULL::timestamp without time zone), ('N'::text), "*SELECT* 1_1".cof_titulo_numdoc, "*SELECT* 1_1".cof_checkallocateamt
88. 0.006 169.102 ↑ 35.2 25 1

Append (cost=2.10..8,474.51 rows=881 width=3,648) (actual time=94.102..169.102 rows=25 loops=1)

89. 0.001 50.596 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1_1 (cost=2.10..3,145.24 rows=25 width=2,259) (actual time=50.596..50.596 rows=0 loops=1)

90. 0.000 50.595 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.10..3,144.93 rows=25 width=2,255) (actual time=50.595..50.595 rows=0 loops=1)

  • Join Filter: (bpg_2.c_bp_group_id = bp_4.c_bp_group_id)
91. 0.001 50.595 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.10..3,071.97 rows=25 width=1,907) (actual time=50.595..50.595 rows=0 loops=1)

92. 0.000 50.594 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.83..3,031.59 rows=25 width=1,894) (actual time=50.594..50.594 rows=0 loops=1)

  • Join Filter: (bo_2.cof_c_bankoccurrence_id = t_4.cof_c_bankoccurrence_id)
93. 0.000 50.594 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.83..3,016.03 rows=25 width=1,658) (actual time=50.594..50.594 rows=0 loops=1)

94. 0.027 50.594 ↓ 0.0 0 1

Nested Loop (cost=1.55..2,976.51 rows=25 width=1,642) (actual time=50.594..50.594 rows=0 loops=1)

  • Join Filter: (i_2.c_paymentterm_id = p_1.c_paymentterm_id)
95. 0.005 0.005 ↑ 1.0 53 1

Seq Scan on c_paymentterm p_1 (cost=0.00..2.53 rows=53 width=15) (actual time=0.002..0.005 rows=53 loops=1)

96. 0.000 50.562 ↓ 0.0 0 53

Materialize (cost=1.55..2,954.17 rows=25 width=1,633) (actual time=0.954..0.954 rows=0 loops=53)

97. 0.000 50.581 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.55..2,954.04 rows=25 width=1,633) (actual time=50.581..50.581 rows=0 loops=1)

  • Join Filter: (t_4.c_invoice_id = i_2.c_invoice_id)
98. 0.001 50.581 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.55..2,950.14 rows=25 width=6,327) (actual time=50.581..50.581 rows=0 loops=1)

99. 0.000 50.580 ↓ 0.0 0 1

Nested Loop (cost=1.27..2,898.54 rows=25 width=544) (actual time=50.580..50.580 rows=0 loops=1)

100. 0.000 50.580 ↓ 0.0 0 1

Nested Loop (cost=0.99..2,890.41 rows=25 width=551) (actual time=50.580..50.580 rows=0 loops=1)

101. 0.001 50.580 ↓ 0.0 0 1

Nested Loop (cost=0.71..2,855.53 rows=25 width=544) (actual time=50.580..50.580 rows=0 loops=1)

102. 0.000 50.579 ↓ 0.0 0 1

Nested Loop (cost=0.43..2,818.45 rows=25 width=544) (actual time=50.579..50.579 rows=0 loops=1)

103. 50.579 50.579 ↓ 0.0 0 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i_2 (cost=0.29..2,803.38 rows=25 width=540) (actual time=50.579..50.579 rows=0 loops=1)

  • Index Cond: ((ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric))
  • Filter: ((ispayschedulevalid <> 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL}'::bpchar[])) AND (issotrx = 'Y'::bpchar) AND (cof_composescashflow = 'Y'::bpchar) AND (invoiceopen(c_invoice_id, '0'::numeric) <> '0'::numeric))
  • Rows Removed by Filter: 7280
104. 0.000 0.000 ↓ 0.0 0

Index Scan using c_doctype_pkey on c_doctype d_2 (cost=0.14..0.60 rows=1 width=10) (never executed)

  • Index Cond: (c_doctype_id = i_2.c_doctype_id)
105. 0.000 0.000 ↓ 0.0 0

Index Only Scan using c_bpartner_pkey on c_bpartner b_2 (cost=0.28..1.48 rows=1 width=6) (never executed)

  • Index Cond: (c_bpartner_id = i_2.c_bpartner_id)
  • Heap Fetches: 0
106. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl_2 (cost=0.28..1.40 rows=1 width=13) (never executed)

  • Index Cond: (c_bpartner_location_id = i_2.c_bpartner_location_id)
107. 0.000 0.000 ↓ 0.0 0

Index Only Scan using c_location_pkey on c_location loc_2 (cost=0.29..0.33 rows=1 width=6) (never executed)

  • Index Cond: (c_location_id = bpl_2.c_location_id)
  • Heap Fetches: 0
108. 0.000 0.000 ↓ 0.0 0

Index Only Scan using cof_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_5 (cost=0.28..0.78 rows=1 width=7) (never executed)

  • Index Cond: (c_invoice_id = i_2.c_invoice_id)
  • Heap Fetches: 0
109. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..3.27 rows=1 width=996) (never executed)

110. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=0.00..3.27 rows=1 width=996) (never executed)

  • Join Filter: (bi_2.cof_c_bankintegration_id = t_4.cof_c_bankintegration_id)
111. 0.000 0.000 ↓ 0.0 0

Seq Scan on cof_titulo t_4 (cost=0.00..2.23 rows=1 width=858) (never executed)

  • Filter: ((COALESCE(c_invoicepayschedule_id, '0'::numeric) = '0'::numeric) AND (isvalid = 'Y'::bpchar))
112. 0.000 0.000 ↓ 0.0 0

Seq Scan on cof_c_bankintegration bi_2 (cost=0.00..1.02 rows=2 width=154) (never executed)

113. 0.000 0.000 ↓ 0.0 0

Index Scan using cof_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_4 (cost=0.28..1.57 rows=1 width=23) (never executed)

  • Index Cond: (c_invoice_id = i_2.c_invoice_id)
114. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.59 rows=39 width=252) (never executed)

115. 0.000 0.000 ↓ 0.0 0

Seq Scan on cof_c_bankoccurrence bo_2 (cost=0.00..1.39 rows=39 width=252) (never executed)

116. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bp_4 (cost=0.28..1.62 rows=1 width=19) (never executed)

  • Index Cond: (c_bpartner_id = i_2.c_bpartner_id)
117. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.10 rows=7 width=16) (never executed)

118. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_bp_group bpg_2 (cost=0.00..1.07 rows=7 width=16) (never executed)

119. 0.034 118.500 ↑ 34.2 25 1

Subquery Scan on *SELECT* 2_1 (cost=2,409.50..5,329.27 rows=856 width=2,189) (actual time=43.505..118.500 rows=25 loops=1)

120. 21.070 118.466 ↑ 34.2 25 1

Hash Left Join (cost=2,409.50..5,316.43 rows=856 width=2,161) (actual time=43.503..118.466 rows=25 loops=1)

  • Hash Cond: ((i_3.c_invoice_id = t_5.c_invoice_id) AND (ips_1.c_invoicepayschedule_id = t_5.c_invoicepayschedule_id))
121. 56.542 97.348 ↑ 34.2 25 1

Hash Join (cost=2,404.70..3,130.95 rows=856 width=676) (actual time=42.886..97.348 rows=25 loops=1)

  • Hash Cond: (ips_1.c_invoice_id = i_3.c_invoice_id)
  • Join Filter: (invoiceopen(i_3.c_invoice_id, ips_1.c_invoicepayschedule_id) <> '0'::numeric)
  • Rows Removed by Join Filter: 171
122. 2.254 2.254 ↓ 1.0 12,011 1

Seq Scan on c_invoicepayschedule ips_1 (cost=0.00..455.48 rows=11,937 width=54) (actual time=0.003..2.254 rows=12,011 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 23
123. 0.215 38.552 ↑ 4.7 148 1

Hash (cost=2,396.06..2,396.06 rows=691 width=628) (actual time=38.552..38.552 rows=148 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 65kB
124. 0.089 38.337 ↑ 4.7 148 1

Hash Left Join (cost=645.10..2,396.06 rows=691 width=628) (actual time=3.091..38.337 rows=148 loops=1)

  • Hash Cond: (bp_5.c_bp_group_id = bpg_3.c_bp_group_id)
125. 0.105 38.242 ↑ 4.7 148 1

Hash Left Join (cost=643.95..2,391.99 rows=691 width=618) (actual time=3.081..38.242 rows=148 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = bp_5.c_bpartner_id)
126. 0.115 37.600 ↑ 4.7 148 1

Hash Left Join (cost=529.31..2,275.54 rows=691 width=605) (actual time=2.540..37.600 rows=148 loops=1)

  • Hash Cond: (i_3.c_invoice_id = df_6.c_invoice_id)
127. 30.351 36.504 ↑ 4.7 148 1

Hash Left Join (cost=277.49..2,007.31 rows=691 width=6,327) (actual time=1.554..36.504 rows=148 loops=1)

  • Hash Cond: (i_3.c_invoice_id = df_7.c_invoice_id)
128. 0.106 5.833 ↑ 4.7 148 1

Nested Loop (cost=191.84..1,389.70 rows=691 width=538) (actual time=0.921..5.833 rows=148 loops=1)

129. 0.093 5.431 ↑ 4.7 148 1

Hash Join (cost=191.56..1,164.72 rows=691 width=545) (actual time=0.915..5.431 rows=148 loops=1)

  • Hash Cond: (i_3.c_bpartner_location_id = bpl_3.c_bpartner_location_id)
130. 0.102 4.895 ↑ 4.7 148 1

Hash Join (cost=126.39..1,097.73 rows=691 width=538) (actual time=0.469..4.895 rows=148 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = b_3.c_bpartner_id)
131. 0.099 4.413 ↑ 4.7 148 1

Hash Join (cost=11.75..981.28 rows=691 width=538) (actual time=0.086..4.413 rows=148 loops=1)

  • Hash Cond: (i_3.c_doctype_id = d_3.c_doctype_id)
132. 4.260 4.260 ↑ 4.7 148 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i_3 (cost=0.29..967.96 rows=691 width=534) (actual time=0.028..4.260 rows=148 loops=1)

  • Index Cond: ((ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ispayschedulevalid = 'Y'::bpchar) AND (issotrx = 'Y'::bpchar) AND (cof_composescashflow = 'Y'::bpchar))
  • Rows Removed by Filter: 7132
133. 0.023 0.054 ↑ 1.0 154 1

Hash (cost=9.54..9.54 rows=154 width=10) (actual time=0.054..0.054 rows=154 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 15kB
134. 0.031 0.031 ↑ 1.0 154 1

Seq Scan on c_doctype d_3 (cost=0.00..9.54 rows=154 width=10) (actual time=0.005..0.031 rows=154 loops=1)

135. 0.180 0.380 ↓ 1.0 1,413 1

Hash (cost=97.06..97.06 rows=1,406 width=6) (actual time=0.380..0.380 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 70kB
136. 0.200 0.200 ↓ 1.0 1,413 1

Seq Scan on c_bpartner b_3 (cost=0.00..97.06 rows=1,406 width=6) (actual time=0.003..0.200 rows=1,413 loops=1)

137. 0.206 0.443 ↓ 1.0 1,442 1

Hash (cost=47.30..47.30 rows=1,430 width=13) (actual time=0.443..0.443 rows=1,442 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 81kB
138. 0.237 0.237 ↓ 1.0 1,442 1

Seq Scan on c_bpartner_location bpl_3 (cost=0.00..47.30 rows=1,430 width=13) (actual time=0.003..0.237 rows=1,442 loops=1)

139. 0.296 0.296 ↑ 1.0 1 148

Index Only Scan using c_location_pkey on c_location loc_3 (cost=0.29..0.33 rows=1 width=6) (actual time=0.002..0.002 rows=1 loops=148)

  • Index Cond: (c_location_id = bpl_3.c_location_id)
  • Heap Fetches: 2
140. 0.155 0.320 ↑ 1.0 1,102 1

Hash (cost=71.86..71.86 rows=1,103 width=7) (actual time=0.320..0.320 rows=1,102 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 58kB
141. 0.165 0.165 ↑ 1.0 1,103 1

Index Only Scan using cof_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_7 (cost=0.28..71.86 rows=1,103 width=7) (actual time=0.009..0.165 rows=1,103 loops=1)

  • Heap Fetches: 215
142. 0.184 0.981 ↑ 1.0 1,102 1

Hash (cost=238.03..238.03 rows=1,103 width=23) (actual time=0.981..0.981 rows=1,102 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 73kB
143. 0.797 0.797 ↑ 1.0 1,103 1

Seq Scan on lbr_docfiscal df_6 (cost=0.00..238.03 rows=1,103 width=23) (actual time=0.004..0.797 rows=1,103 loops=1)

144. 0.234 0.537 ↓ 1.0 1,413 1

Hash (cost=97.06..97.06 rows=1,406 width=19) (actual time=0.537..0.537 rows=1,413 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 90kB
145. 0.303 0.303 ↓ 1.0 1,413 1

Seq Scan on c_bpartner bp_5 (cost=0.00..97.06 rows=1,406 width=19) (actual time=0.003..0.303 rows=1,413 loops=1)

146. 0.003 0.006 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=16) (actual time=0.006..0.006 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
147. 0.003 0.003 ↑ 1.0 7 1

Seq Scan on c_bp_group bpg_3 (cost=0.00..1.07 rows=7 width=16) (actual time=0.002..0.003 rows=7 loops=1)

148. 0.004 0.048 ↓ 11.0 11 1

Hash (cost=4.79..4.79 rows=1 width=1,248) (actual time=0.048..0.048 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
149. 0.011 0.044 ↓ 11.0 11 1

Nested Loop Left Join (cost=2.20..4.79 rows=1 width=1,248) (actual time=0.034..0.044 rows=11 loops=1)

  • Join Filter: (bi_3.cof_c_bankintegration_id = t_5.cof_c_bankintegration_id)
  • Rows Removed by Join Filter: 1
150. 0.013 0.033 ↓ 11.0 11 1

Hash Right Join (cost=2.20..3.75 rows=1 width=1,110) (actual time=0.031..0.033 rows=11 loops=1)

  • Hash Cond: (bo_3.cof_c_bankoccurrence_id = t_5.cof_c_bankoccurrence_id)
151. 0.003 0.003 ↑ 1.0 39 1

Seq Scan on cof_c_bankoccurrence bo_3 (cost=0.00..1.39 rows=39 width=252) (actual time=0.002..0.003 rows=39 loops=1)

152. 0.003 0.017 ↓ 11.0 11 1

Hash (cost=2.19..2.19 rows=1 width=874) (actual time=0.017..0.017 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
153. 0.014 0.014 ↓ 11.0 11 1

Seq Scan on cof_titulo t_5 (cost=0.00..2.19 rows=1 width=874) (actual time=0.005..0.014 rows=11 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 4
154. 0.000 0.000 ↑ 2.0 1 11

Seq Scan on cof_c_bankintegration bi_3 (cost=0.00..1.02 rows=2 width=154) (actual time=0.000..0.000 rows=1 loops=11)

155.          

SubPlan (forHash Left Join)

156. 0.000 0.000 ↑ 1.0 1 25

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

157. 0.007 0.020 ↓ 11.0 11 1

Hash (cost=2.19..2.19 rows=1 width=44) (actual time=0.020..0.020 rows=11 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
158. 0.013 0.013 ↓ 11.0 11 1

Seq Scan on cof_titulo t_3 (cost=0.00..2.19 rows=1 width=44) (actual time=0.004..0.013 rows=11 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 4
159. 0.001 0.004 ↑ 1.0 2 1

Hash (cost=1.02..1.02 rows=2 width=32) (actual time=0.004..0.004 rows=2 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
160. 0.003 0.003 ↑ 1.0 2 1

Seq Scan on cof_c_bankintegration bai (cost=0.00..1.02 rows=2 width=32) (actual time=0.003..0.003 rows=2 loops=1)

161. 0.002 0.020 ↑ 1.0 10 1

Hash (cost=1.10..1.10 rows=10 width=32) (actual time=0.020..0.020 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
162. 0.018 0.018 ↑ 1.0 10 1

Seq Scan on cof_c_custody cu (cost=0.00..1.10 rows=10 width=32) (actual time=0.017..0.018 rows=10 loops=1)

163. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bp_3 (cost=0.28..0.41 rows=1 width=39) (never executed)

  • Index Cond: ("*SELECT* 1_1".c_bpartner_id = c_bpartner_id)
164. 6.304 14.176 ↓ 3.0 3 1

Nested Loop Anti Join (cost=0.55..1,085.50 rows=1 width=149) (actual time=5.082..14.176 rows=3 loops=1)

  • Join Filter: (i_4.c_cashplanline_id = cpl.c_cashplanline_id)
  • Rows Removed by Join Filter: 27273
165. 0.006 1.383 ↓ 3.0 3 1

Nested Loop Left Join (cost=0.55..43.03 rows=1 width=66) (actual time=0.816..1.383 rows=3 loops=1)

166. 0.013 1.359 ↓ 3.0 3 1

Nested Loop (cost=0.27..40.86 rows=1 width=40) (actual time=0.807..1.359 rows=3 loops=1)

  • Join Filter: (cp.c_cashplan_id = cpl.c_cashplan_id)
  • Rows Removed by Join Filter: 30
167. 1.138 1.138 ↑ 1.0 4 1

Index Scan using c_cashplanline_key on c_cashplanline cpl (cost=0.27..35.38 rows=4 width=19) (actual time=0.606..1.138 rows=4 loops=1)

  • Filter: (datetrx = '2018-12-20'::date)
  • Rows Removed by Filter: 464
168. 0.006 0.208 ↑ 1.2 8 4

Materialize (cost=0.00..4.91 rows=10 width=33) (actual time=0.003..0.052 rows=8 loops=4)

169. 0.202 0.202 ↑ 1.1 9 1

Seq Scan on c_cashplan cp (cost=0.00..4.86 rows=10 width=33) (actual time=0.008..0.202 rows=9 loops=1)

  • Filter: ((issotrx = 'Y'::bpchar) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric))
  • Rows Removed by Filter: 39
170. 0.018 0.018 ↑ 1.0 1 3

Index Scan using c_bpartner_pkey on c_bpartner bp_6 (cost=0.28..2.17 rows=1 width=39) (actual time=0.006..0.006 rows=1 loops=3)

  • Index Cond: (cp.c_bpartner_id = c_bpartner_id)
171. 6.489 6.489 ↑ 1.0 9,091 3

Seq Scan on c_invoice i_4 (cost=0.00..928.81 rows=9,093 width=16) (actual time=0.002..2.163 rows=9,091 loops=3)

  • Filter: (docstatus <> ALL ('{RE,VO}'::bpchar[]))
  • Rows Removed by Filter: 894
172. 0.003 2.621 ↑ 2.0 1 1

Nested Loop Left Join (cost=1,042.89..1,077.67 rows=2 width=149) (actual time=2.619..2.621 rows=1 loops=1)

173. 0.002 2.613 ↑ 2.0 1 1

Nested Loop (cost=1,042.62..1,074.82 rows=2 width=33) (actual time=2.611..2.613 rows=1 loops=1)

174. 0.017 2.599 ↓ 2.0 4 1

Hash Anti Join (cost=1,042.47..1,071.67 rows=2 width=12) (actual time=2.546..2.599 rows=4 loops=1)

  • Hash Cond: (cpl_1.c_cashplanline_id = i_5.c_cashplanline_id)
175. 0.064 0.064 ↑ 1.0 4 1

Seq Scan on c_cashplanline cpl_1 (cost=0.00..26.89 rows=4 width=19) (actual time=0.012..0.064 rows=4 loops=1)

  • Filter: (datetrx = '2018-12-20'::date)
  • Rows Removed by Filter: 464
176. 0.260 2.518 ↓ 0.0 0 1

Hash (cost=928.81..928.81 rows=9,093 width=16) (actual time=2.518..2.518 rows=0 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 128kB
177. 2.258 2.258 ↑ 1.0 9,091 1

Seq Scan on c_invoice i_5 (cost=0.00..928.81 rows=9,093 width=16) (actual time=0.003..2.258 rows=9,091 loops=1)

  • Filter: (docstatus <> ALL ('{RE,VO}'::bpchar[]))
  • Rows Removed by Filter: 894
178. 0.012 0.012 ↓ 0.0 0 4

Index Scan using c_cashplan_key on c_cashplan cp_1 (cost=0.14..1.54 rows=1 width=33) (actual time=0.003..0.003 rows=0 loops=4)

  • Index Cond: (c_cashplan_id = cpl_1.c_cashplan_id)
  • Filter: ((issotrx = 'N'::bpchar) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric))
  • Rows Removed by Filter: 1
179. 0.005 0.005 ↑ 1.0 1 1

Index Scan using c_bpartner_pkey on c_bpartner bp_7 (cost=0.28..1.42 rows=1 width=39) (actual time=0.005..0.005 rows=1 loops=1)

  • Index Cond: (cp_1.c_bpartner_id = c_bpartner_id)
180. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.56..7,886.43 rows=1 width=148) (actual time=0.007..0.007 rows=0 loops=1)

181. 0.001 0.007 ↓ 0.0 0 1

Nested Loop (cost=0.29..7,883.67 rows=1 width=52) (actual time=0.007..0.007 rows=0 loops=1)

182. 0.006 0.006 ↓ 0.0 0 1

Seq Scan on c_bankaccount ba (cost=0.00..1.16 rows=1 width=6) (actual time=0.006..0.006 rows=0 loops=1)

  • Filter: (cof_contatransitoriacredito = 'Y'::bpchar)
  • Rows Removed by Filter: 13
183. 0.000 0.000 ↓ 0.0 0

Index Scan using c_payment_bankaccount on c_payment (cost=0.29..7,882.50 rows=1 width=57) (never executed)

  • Index Cond: (c_bankaccount_id = ba.c_bankaccount_id)
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (isreceipt = 'Y'::bpchar) AND (isallocated = 'Y'::bpchar) AND (datetrx = '2018-12-20'::date) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric) AND ((SubPlan 1) <= 0))
184.          

SubPlan (forIndex Scan)

185. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=5.01..5.02 rows=1 width=8) (never executed)

186. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.56..5.00 rows=1 width=6) (never executed)

187. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_c_bankstatementline_c_payment_id on c_bankstatementline bsl (cost=0.29..2.50 rows=1 width=13) (never executed)

  • Index Cond: (c_payment_id = c_payment.c_payment_id)
188. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bankstatement_pkey on c_bankstatement bs (cost=0.28..2.50 rows=1 width=7) (never executed)

  • Index Cond: (c_bankstatement_id = bsl.c_bankstatement_id)
  • Filter: (docstatus = ANY ('{CO,CL}'::bpchar[]))
189. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bp_8 (cost=0.28..2.50 rows=1 width=39) (never executed)

  • Index Cond: (c_bpartner_id = c_payment.c_bpartner_id)
190. 0.000 0.030 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.56..11.54 rows=1 width=148) (actual time=0.030..0.030 rows=0 loops=1)

191. 0.001 0.030 ↓ 0.0 0 1

Nested Loop (cost=0.29..9.04 rows=1 width=31) (actual time=0.030..0.030 rows=0 loops=1)

192. 0.029 0.029 ↓ 0.0 0 1

Seq Scan on cof_c_controlcheck cc (cost=0.00..4.29 rows=1 width=23) (actual time=0.029..0.029 rows=0 loops=1)

  • Filter: ((changedate IS NULL) AND (cof_dateresubmit2 IS NULL) AND (dateto = '2018-12-20'::date) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = '1000001'::numeric))
  • Rows Removed by Filter: 74
193. 0.000 0.000 ↓ 0.0 0

Index Scan using c_payment_pkey on c_payment p_2 (cost=0.29..2.51 rows=1 width=21) (never executed)

  • Index Cond: (c_payment_id = cc.cof_payment_id)
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (isreceipt = 'N'::bpchar) AND (isreconciled = 'N'::bpchar) AND (tendertype = 'K'::bpchar))
194. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bp_9 (cost=0.28..2.50 rows=1 width=39) (never executed)

  • Index Cond: (c_bpartner_id = p_2.c_bpartner_id)