explain.depesz.com

PostgreSQL's explain analyze made readable

Result: u7po

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 264,613.796 ↑ 113.0 2 1

HashAggregate (cost=539,456.35..539,458.61 rows=226 width=924) (actual time=264,613.795..264,613.796 rows=2 loops=1)

  • Group Key: ('04'::text), ('PAGAR'::text), oi.documentno, (currencyconvert(oi.openamt, oi.c_currency_id, '297'::numeric, '2019-02-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, u1.name, ac.name, pf.name, oi.description
2. 0.005 264,613.786 ↑ 113.0 2 1

Append (cost=138,858.58..539,450.13 rows=226 width=924) (actual time=32,565.886..264,613.786 rows=2 loops=1)

3. 0.009 32,566.444 ↑ 47.0 1 1

Hash Left Join (cost=138,858.58..139,462.86 rows=47 width=800) (actual time=32,565.885..32,566.444 rows=1 loops=1)

  • Hash Cond: (oi.cof_c_planofinanceiro_id = pf.cof_c_planofinanceiro_id)
4. 0.006 32,566.431 ↑ 47.0 1 1

Hash Left Join (cost=138,857.55..139,449.97 rows=47 width=772) (actual time=32,565.872..32,566.431 rows=1 loops=1)

  • Hash Cond: (oi.c_activity_id = ac.c_activity_id)
5. 0.003 32,566.408 ↑ 47.0 1 1

Nested Loop Left Join (cost=138,856.08..139,448.37 rows=47 width=773) (actual time=32,565.849..32,566.408 rows=1 loops=1)

6. 0.013 32,566.389 ↑ 47.0 1 1

Nested Loop Left Join (cost=138,855.81..139,407.54 rows=47 width=766) (actual time=32,565.831..32,566.389 rows=1 loops=1)

7. 0.003 32,566.368 ↑ 47.0 1 1

Nested Loop Left Join (cost=138,855.52..139,300.36 rows=47 width=754) (actual time=32,565.810..32,566.368 rows=1 loops=1)

  • Filter: ((t.cof_billfoldtype IS NULL) OR ((t.cof_billfoldtype)::text = 'CS'::text))
8. 0.078 32,566.363 ↑ 63.0 1 1

Subquery Scan on oi (cost=138,855.10..139,137.81 rows=63 width=770) (actual time=32,565.806..32,566.363 rows=1 loops=1)

  • Filter: (oi.duedate = '2019-03-27'::date)
  • Rows Removed by Filter: 630
9. 6.874 32,566.285 ↑ 19.9 631 1

HashAggregate (cost=138,855.10..138,980.75 rows=12,565 width=3,648) (actual time=32,565.246..32,566.285 rows=631 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
10. 0.182 32,559.411 ↑ 19.9 631 1

Append (cost=49.94..135,336.90 rows=12,565 width=3,648) (actual time=9,646.175..32,559.411 rows=631 loops=1)

11. 0.000 3,763.320 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=49.94..40,377.74 rows=2,192 width=1,343) (actual time=3,763.320..3,763.320 rows=0 loops=1)

12. 0.000 3,763.320 ↓ 0.0 0 1

Hash Left Join (cost=49.94..40,350.34 rows=2,192 width=1,339) (actual time=3,763.320..3,763.320 rows=0 loops=1)

  • Hash Cond: (bp_1.c_bp_group_id = bpg.c_bp_group_id)
13. 0.001 3,763.320 ↓ 0.0 0 1

Nested Loop Left Join (cost=48.36..31,431.59 rows=2,192 width=895) (actual time=3,763.320..3,763.320 rows=0 loops=1)

14. 0.001 3,763.319 ↓ 0.0 0 1

Hash Left Join (cost=48.07..28,986.55 rows=2,192 width=872) (actual time=3,763.319..3,763.319 rows=0 loops=1)

  • Hash Cond: (t_1.cof_c_bankoccurrence_id = bo.cof_c_bankoccurrence_id)
15. 0.000 3,763.318 ↓ 0.0 0 1

Nested Loop Left Join (cost=39.22..28,971.80 rows=2,192 width=829) (actual time=3,763.318..3,763.318 rows=0 loops=1)

  • Join Filter: (bi.cof_c_bankintegration_id = t_1.cof_c_bankintegration_id)
16. 0.001 3,763.318 ↓ 0.0 0 1

Nested Loop Left Join (cost=39.22..28,701.12 rows=2,192 width=805) (actual time=3,763.318..3,763.318 rows=0 loops=1)

17. 0.000 3,763.317 ↓ 0.0 0 1

Nested Loop Left Join (cost=38.80..23,329.46 rows=2,192 width=585) (actual time=3,763.317..3,763.317 rows=0 loops=1)

18. 0.009 3,763.317 ↓ 0.0 0 1

Hash Join (cost=38.38..19,316.94 rows=2,192 width=569) (actual time=3,763.317..3,763.317 rows=0 loops=1)

  • Hash Cond: (i.c_paymentterm_id = p.c_paymentterm_id)
19. 0.000 3,763.025 ↓ 0.0 0 1

Nested Loop Left Join (cost=16.79..19,289.54 rows=2,192 width=560) (actual time=3,763.025..3,763.025 rows=0 loops=1)

20. 0.000 3,763.025 ↓ 0.0 0 1

Nested Loop (cost=16.37..17,628.82 rows=2,192 width=560) (actual time=3,763.025..3,763.025 rows=0 loops=1)

21. 0.009 3,763.025 ↓ 0.0 0 1

Nested Loop (cost=16.08..16,940.83 rows=2,192 width=566) (actual time=3,763.025..3,763.025 rows=0 loops=1)

22. 0.000 3,763.016 ↓ 0.0 0 1

Nested Loop (cost=15.66..13,129.51 rows=2,192 width=560) (actual time=3,763.016..3,763.016 rows=0 loops=1)

23. 0.001 3,763.016 ↓ 0.0 0 1

Hash Join (cost=15.37..12,327.87 rows=2,192 width=560) (actual time=3,763.016..3,763.016 rows=0 loops=1)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
24. 3,763.015 3,763.015 ↓ 0.0 0 1

Index Scan using idx_c_invoice_issotrx_processed_updated_ad_client_ad_org_id_c_i on c_invoice i (cost=0.42..12,307.05 rows=2,192 width=556) (actual time=3,763.015..3,763.015 rows=0 loops=1)

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

Hash (cost=12.20..12.20 rows=220 width=10) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_doctype d (cost=0.00..12.20 rows=220 width=10) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Index Only Scan using c_bpartner_pkey on c_bpartner b (cost=0.29..0.37 rows=1 width=6) (never executed)

  • Index Cond: (c_bpartner_id = i.c_bpartner_id)
  • Heap Fetches: 0
28. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl (cost=0.42..1.74 rows=1 width=12) (never executed)

  • Index Cond: (c_bpartner_location_id = i.c_bpartner_location_id)
29. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_location_id = bpl.c_location_id)
  • Heap Fetches: 0
30. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_1 (cost=0.42..0.75 rows=1 width=6) (never executed)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Heap Fetches: 0
31. 0.103 0.283 ↑ 1.0 426 1

Hash (cost=16.26..16.26 rows=426 width=15) (actual time=0.283..0.283 rows=426 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
32. 0.180 0.180 ↑ 1.0 426 1

Seq Scan on c_paymentterm p (cost=0.00..16.26 rows=426 width=15) (actual time=0.006..0.180 rows=426 loops=1)

33. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df (cost=0.42..1.82 rows=1 width=22) (never executed)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
34. 0.000 0.000 ↓ 0.0 0

Index Scan using cof_titulo_c_invoice_id on cof_titulo t_1 (cost=0.42..2.44 rows=1 width=226) (never executed)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Filter: ((COALESCE(c_invoicepayschedule_id, '0'::numeric) = '0'::numeric) AND (isvalid = 'Y'::bpchar))
35. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.14 rows=9 width=30) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Seq Scan on cof_c_bankintegration bi (cost=0.00..1.09 rows=9 width=30) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Hash (cost=6.71..6.71 rows=171 width=50) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Seq Scan on cof_c_bankoccurrence bo (cost=0.00..6.71 rows=171 width=50) (never executed)

39. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bp_1 (cost=0.29..1.12 rows=1 width=29) (never executed)

  • Index Cond: (c_bpartner_id = i.c_bpartner_id)
40. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.26..1.26 rows=26 width=6) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_bp_group bpg (cost=0.00..1.26 rows=26 width=6) (never executed)

42. 1.165 28,795.909 ↑ 16.4 631 1

Subquery Scan on *SELECT* 2 (cost=28,228.07..94,959.15 rows=10,373 width=1,272) (actual time=5,882.854..28,795.909 rows=631 loops=1)

43. 1,003.768 28,794.744 ↑ 16.4 631 1

Hash Left Join (cost=28,228.07..94,803.56 rows=10,373 width=1,244) (actual time=5,882.849..28,794.744 rows=631 loops=1)

  • Hash Cond: (bp_2.c_bp_group_id = bpg_1.c_bp_group_id)
44. 0.621 27,790.331 ↑ 16.4 631 1

Hash Left Join (cost=28,226.48..63,080.79 rows=10,373 width=927) (actual time=5,879.102..27,790.331 rows=631 loops=1)

  • Hash Cond: (t_2.cof_c_bankoccurrence_id = bo_1.cof_c_bankoccurrence_id)
45. 0.769 27,789.618 ↑ 16.4 631 1

Hash Left Join (cost=28,217.64..63,044.06 rows=10,373 width=884) (actual time=5,879.005..27,789.618 rows=631 loops=1)

  • Hash Cond: (t_2.cof_c_bankintegration_id = bi_1.cof_c_bankintegration_id)
46. 1.415 27,788.837 ↑ 16.4 631 1

Nested Loop Left Join (cost=28,216.43..63,002.80 rows=10,373 width=860) (actual time=5,878.987..27,788.837 rows=631 loops=1)

  • Join Filter: (t_2.c_invoice_id = i_1.c_invoice_id)
47. 1.652 27,784.898 ↑ 16.4 631 1

Nested Loop Left Join (cost=28,216.01..57,353.53 rows=10,373 width=640) (actual time=5,878.969..27,784.898 rows=631 loops=1)

48. 27,409.233 27,779.460 ↑ 16.4 631 1

Hash Join (cost=28,215.59..41,838.14 rows=10,373 width=624) (actual time=5,878.956..27,779.460 rows=631 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: 9501
49. 100.712 100.712 ↓ 1.0 267,568 1

Seq Scan on c_invoicepayschedule ips (cost=0.00..9,882.86 rows=267,499 width=54) (actual time=0.006..100.712 rows=267,568 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 191
50. 8.591 269.515 ↑ 1.2 8,579 1

Hash (cost=28,086.47..28,086.47 rows=10,330 width=576) (actual time=269.515..269.515 rows=8,579 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 3385kB
51. 6.189 260.924 ↑ 1.2 8,579 1

Hash Left Join (cost=26,048.22..28,086.47 rows=10,330 width=576) (actual time=209.361..260.924 rows=8,579 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = bp_2.c_bpartner_id)
52. 5.830 228.054 ↑ 1.2 8,579 1

Hash Join (cost=22,770.49..24,781.62 rows=10,330 width=553) (actual time=182.585..228.054 rows=8,579 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = b_1.c_bpartner_id)
53. 5.897 205.330 ↑ 1.2 8,579 1

Hash Join (cost=21,502.58..23,486.60 rows=10,330 width=553) (actual time=165.575..205.330 rows=8,579 loops=1)

  • Hash Cond: (i_1.c_doctype_id = d_1.c_doctype_id)
54. 23.340 199.316 ↑ 1.2 8,579 1

Hash Join (cost=21,487.63..23,444.01 rows=10,330 width=549) (actual time=165.444..199.316 rows=8,579 loops=1)

  • Hash Cond: (loc_1.c_location_id = bpl_1.c_location_id)
55. 10.618 10.618 ↓ 1.0 85,062 1

Index Only Scan using c_location_pkey on c_location loc_1 (cost=0.29..1,534.45 rows=85,044 width=6) (actual time=0.042..10.618 rows=85,062 loops=1)

  • Heap Fetches: 941
56. 8.267 165.358 ↑ 1.2 8,579 1

Hash (cost=21,358.22..21,358.22 rows=10,330 width=555) (actual time=165.358..165.358 rows=8,579 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 3197kB
57. 6.427 157.091 ↑ 1.2 8,579 1

Hash Join (cost=16,848.15..21,358.22 rows=10,330 width=555) (actual time=80.227..157.091 rows=8,579 loops=1)

  • Hash Cond: (i_1.c_bpartner_location_id = bpl_1.c_bpartner_location_id)
58. 42.044 106.473 ↑ 1.2 8,579 1

Hash Right Join (cost=9,146.78..13,629.73 rows=10,330 width=549) (actual time=35.871..106.473 rows=8,579 loops=1)

  • Hash Cond: (df_3.c_invoice_id = i_1.c_invoice_id)
59. 28.818 28.818 ↑ 1.0 215,752 1

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_3 (cost=0.42..3,916.93 rows=215,781 width=6) (actual time=0.041..28.818 rows=215,752 loops=1)

  • Heap Fetches: 2739
60. 7.329 35.611 ↑ 1.2 8,578 1

Hash (cost=9,017.23..9,017.23 rows=10,330 width=549) (actual time=35.611..35.611 rows=8,578 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 3138kB
61. 28.282 28.282 ↑ 1.2 8,578 1

Index Scan using idx_c_invoice_issotrx_processed_updated_ad_client_ad_org_id_c_i on c_invoice i_1 (cost=0.42..9,017.23 rows=10,330 width=549) (actual time=0.395..28.282 rows=8,578 loops=1)

  • Index Cond: ((issotrx = 'N'::bpchar) AND (ad_client_id = '1000001'::numeric) AND (ad_org_id = '1000003'::numeric))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ispayschedulevalid = 'Y'::bpchar) AND (cof_composescashflow = 'Y'::bpchar))
  • Rows Removed by Filter: 1850
62. 15.592 44.191 ↓ 1.0 66,877 1

Hash (cost=6,865.61..6,865.61 rows=66,861 width=12) (actual time=44.191..44.191 rows=66,877 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4029kB
63. 28.599 28.599 ↓ 1.0 66,877 1

Seq Scan on c_bpartner_location bpl_1 (cost=0.00..6,865.61 rows=66,861 width=12) (actual time=0.005..28.599 rows=66,877 loops=1)

64. 0.044 0.117 ↑ 1.0 220 1

Hash (cost=12.20..12.20 rows=220 width=10) (actual time=0.117..0.117 rows=220 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
65. 0.073 0.073 ↑ 1.0 220 1

Seq Scan on c_doctype d_1 (cost=0.00..12.20 rows=220 width=10) (actual time=0.006..0.073 rows=220 loops=1)

66. 8.482 16.894 ↓ 1.0 41,462 1

Hash (cost=749.71..749.71 rows=41,455 width=6) (actual time=16.894..16.894 rows=41,462 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2092kB
67. 8.412 8.412 ↓ 1.0 41,462 1

Index Only Scan using c_bpartner_pkey on c_bpartner b_1 (cost=0.29..749.71 rows=41,455 width=6) (actual time=0.030..8.412 rows=41,462 loops=1)

  • Heap Fetches: 7693
68. 12.741 26.681 ↓ 1.0 41,462 1

Hash (cost=2,759.55..2,759.55 rows=41,455 width=29) (actual time=26.681..26.681 rows=41,462 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3058kB
69. 13.940 13.940 ↓ 1.0 41,462 1

Seq Scan on c_bpartner bp_2 (cost=0.00..2,759.55 rows=41,455 width=29) (actual time=0.011..13.940 rows=41,462 loops=1)

70. 3.786 3.786 ↓ 0.0 0 631

Index Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_2 (cost=0.42..1.49 rows=1 width=22) (actual time=0.006..0.006 rows=0 loops=631)

  • Index Cond: (c_invoice_id = i_1.c_invoice_id)
71. 2.524 2.524 ↓ 0.0 0 631

Index Scan using cof_titulo_c_invoicepayschedule_id on cof_titulo t_2 (cost=0.42..0.53 rows=1 width=232) (actual time=0.004..0.004 rows=0 loops=631)

  • Index Cond: (c_invoicepayschedule_id = ips.c_invoicepayschedule_id)
  • Filter: (isvalid = 'Y'::bpchar)
72. 0.004 0.012 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=30) (actual time=0.012..0.012 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
73. 0.008 0.008 ↑ 1.0 9 1

Seq Scan on cof_c_bankintegration bi_1 (cost=0.00..1.09 rows=9 width=30) (actual time=0.005..0.008 rows=9 loops=1)

74. 0.043 0.092 ↑ 1.0 171 1

Hash (cost=6.71..6.71 rows=171 width=50) (actual time=0.092..0.092 rows=171 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
75. 0.049 0.049 ↑ 1.0 171 1

Seq Scan on cof_c_bankoccurrence bo_1 (cost=0.00..6.71 rows=171 width=50) (actual time=0.004..0.049 rows=171 loops=1)

76. 0.006 0.014 ↑ 1.0 26 1

Hash (cost=1.26..1.26 rows=26 width=6) (actual time=0.014..0.014 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
77. 0.008 0.008 ↑ 1.0 26 1

Seq Scan on c_bp_group bpg_1 (cost=0.00..1.26 rows=26 width=6) (actual time=0.004..0.008 rows=26 loops=1)

78.          

SubPlan (forHash Left Join)

79. 0.631 0.631 ↑ 1.0 1 631

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

80. 0.002 0.002 ↓ 0.0 0 1

Index Scan using cof_titulo_key on cof_titulo t (cost=0.42..2.57 rows=1 width=9) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (cof_titulo_id = oi.cof_titulo_id)
81. 0.008 0.008 ↑ 1.0 1 1

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

  • Index Cond: (c_bpartner_id = oi.c_bpartner_id)
82. 0.016 0.016 ↑ 1.0 1 1

Index Scan using c_elementvalue_pkey on c_elementvalue u1 (cost=0.28..0.87 rows=1 width=29) (actual time=0.016..0.016 rows=1 loops=1)

  • Index Cond: (c_elementvalue_id = oi.user1_id)
83. 0.005 0.017 ↑ 1.0 21 1

Hash (cost=1.21..1.21 rows=21 width=22) (actual time=0.017..0.017 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
84. 0.012 0.012 ↑ 1.0 21 1

Seq Scan on c_activity ac (cost=0.00..1.21 rows=21 width=22) (actual time=0.005..0.012 rows=21 loops=1)

85. 0.001 0.004 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=17) (actual time=0.004..0.004 rows=1 loops=1)

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

Seq Scan on cof_c_planofinanceiro pf (cost=0.00..1.01 rows=1 width=17) (actual time=0.003..0.003 rows=1 loops=1)

87. 0.016 232,045.110 ↑ 175.0 1 1

Hash Left Join (cost=385,793.16..387,191.85 rows=175 width=800) (actual time=232,041.571..232,045.110 rows=1 loops=1)

  • Hash Cond: ("*SELECT* 1_1".cof_c_planofinanceiro_id = pf_1.cof_c_planofinanceiro_id)
88. 0.004 232,045.089 ↑ 175.0 1 1

Hash Left Join (cost=385,792.14..387,146.61 rows=175 width=772) (actual time=232,041.550..232,045.089 rows=1 loops=1)

  • Hash Cond: ("*SELECT* 1_1".c_activity_id = ac_1.c_activity_id)
89. 0.007 232,045.070 ↑ 175.0 1 1

Hash Left Join (cost=385,790.67..387,144.67 rows=175 width=773) (actual time=232,041.531..232,045.070 rows=1 loops=1)

  • Hash Cond: ("*SELECT* 1_1".user1_id = u1_1.c_elementvalue_id)
90. 0.004 232,044.586 ↑ 175.0 1 1

Nested Loop Left Join (cost=385,741.00..387,094.54 rows=175 width=766) (actual time=232,041.047..232,044.586 rows=1 loops=1)

91. 0.817 232,044.571 ↑ 175.0 1 1

Hash Left Join (cost=385,740.71..387,030.59 rows=175 width=754) (actual time=232,041.033..232,044.571 rows=1 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 = '2019-03-27'::date)
  • Rows Removed by Filter: 1624
92. 0.556 232,043.717 ↑ 21.6 1,625 1

Hash Left Join (cost=385,737.70..386,930.20 rows=35,020 width=794) (actual time=232,039.337..232,043.717 rows=1,625 loops=1)

  • Hash Cond: (t_3.cof_c_bankintegration_id = bai.cof_c_bankintegration_id)
93. 1.081 232,043.147 ↑ 21.6 1,625 1

Hash Left Join (cost=385,736.50..386,793.79 rows=35,020 width=784) (actual time=232,039.313..232,043.147 rows=1,625 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))
  • Rows Removed by Filter: 2
94. 18.566 231,816.755 ↑ 28.7 1,627 1

HashAggregate (cost=359,951.72..360,419.03 rows=46,731 width=3,648) (actual time=231,813.740..231,816.755 rows=1,627 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
95. 0.462 231,798.189 ↑ 28.7 1,627 1

Append (cost=36,634.73..346,867.04 rows=46,731 width=3,648) (actual time=18,131.900..231,798.189 rows=1,627 loops=1)

96. 0.041 18,197.572 ↑ 214.5 38 1

Subquery Scan on *SELECT* 1_1 (cost=36,634.73..107,101.62 rows=8,152 width=1,343) (actual time=18,131.899..18,197.572 rows=38 loops=1)

97. 37.111 18,197.531 ↑ 214.5 38 1

Hash Left Join (cost=36,634.73..106,999.72 rows=8,152 width=1,339) (actual time=18,131.896..18,197.531 rows=38 loops=1)

  • Hash Cond: (bp_4.c_bp_group_id = bpg_2.c_bp_group_id)
98. 0.042 18,160.404 ↑ 214.5 38 1

Hash Left Join (cost=36,633.15..73,835.36 rows=8,152 width=895) (actual time=18,129.606..18,160.404 rows=38 loops=1)

  • Hash Cond: (t_4.cof_c_bankoccurrence_id = bo_2.cof_c_bankoccurrence_id)
99. 0.060 18,160.278 ↑ 214.5 38 1

Hash Left Join (cost=36,624.30..73,804.59 rows=8,152 width=852) (actual time=18,129.516..18,160.278 rows=38 loops=1)

  • Hash Cond: (t_4.cof_c_bankintegration_id = bi_2.cof_c_bankintegration_id)
100. 0.067 18,160.204 ↑ 214.5 38 1

Nested Loop Left Join (cost=36,623.10..73,771.91 rows=8,152 width=828) (actual time=18,129.493..18,160.204 rows=38 loops=1)

101. 0.102 18,159.757 ↑ 214.5 38 1

Nested Loop Left Join (cost=36,622.68..57,785.51 rows=8,152 width=608) (actual time=18,129.480..18,159.757 rows=38 loops=1)

102. 0.075 18,159.351 ↑ 214.5 38 1

Hash Join (cost=36,622.26..45,263.79 rows=8,152 width=592) (actual time=18,129.472..18,159.351 rows=38 loops=1)

  • Hash Cond: (i_2.c_paymentterm_id = p_1.c_paymentterm_id)
103. 7.024 18,159.052 ↑ 214.5 38 1

Merge Left Join (cost=36,600.67..45,220.59 rows=8,152 width=583) (actual time=18,129.240..18,159.052 rows=38 loops=1)

  • Merge Cond: (i_2.c_bpartner_id = bp_4.c_bpartner_id)
104. 0.059 18,140.797 ↑ 214.5 38 1

Nested Loop Left Join (cost=36,600.07..41,902.03 rows=8,152 width=560) (actual time=18,129.110..18,140.797 rows=38 loops=1)

105. 4.892 18,140.510 ↑ 214.5 38 1

Merge Join (cost=36,599.65..37,574.21 rows=8,152 width=560) (actual time=18,129.097..18,140.510 rows=38 loops=1)

  • Merge Cond: (i_2.c_bpartner_id = b_2.c_bpartner_id)
106. 0.088 18,129.029 ↑ 214.5 38 1

Sort (cost=36,599.28..36,619.66 rows=8,152 width=560) (actual time=18,129.014..18,129.029 rows=38 loops=1)

  • Sort Key: i_2.c_bpartner_id
  • Sort Method: quicksort Memory: 44kB
107. 0.030 18,128.941 ↑ 214.5 38 1

Hash Join (cost=34,113.28..36,069.69 rows=8,152 width=560) (actual time=18,111.123..18,128.941 rows=38 loops=1)

  • Hash Cond: (i_2.c_doctype_id = d_2.c_doctype_id)
108. 9.288 18,128.795 ↑ 214.5 38 1

Hash Join (cost=34,098.33..36,032.93 rows=8,152 width=556) (actual time=18,111.001..18,128.795 rows=38 loops=1)

  • Hash Cond: (loc_2.c_location_id = bpl_2.c_location_id)
109. 8.633 8.633 ↓ 1.0 85,062 1

Index Only Scan using c_location_pkey on c_location loc_2 (cost=0.29..1,534.45 rows=85,044 width=6) (actual time=0.015..8.633 rows=85,062 loops=1)

  • Heap Fetches: 941
110. 0.116 18,110.874 ↑ 214.5 38 1

Hash (cost=33,996.14..33,996.14 rows=8,152 width=562) (actual time=18,110.874..18,110.874 rows=38 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 77kB
111. 0.221 18,110.758 ↑ 214.5 38 1

Hash Join (cost=7,701.79..33,996.14 rows=8,152 width=562) (actual time=40.283..18,110.758 rows=38 loops=1)

  • Hash Cond: (i_2.c_bpartner_location_id = bpl_2.c_bpartner_location_id)
112. 18,072.629 18,072.629 ↑ 214.5 38 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i_2 (cost=0.42..26,273.37 rows=8,152 width=556) (actual time=2.258..18,072.629 rows=38 loops=1)

  • Index Cond: ((ad_client_id = '1000001'::numeric) AND (ad_org_id = '1000003'::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: 61793
113. 13.530 37.908 ↓ 1.0 66,877 1

Hash (cost=6,865.61..6,865.61 rows=66,861 width=12) (actual time=37.908..37.908 rows=66,877 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4029kB
114. 24.378 24.378 ↓ 1.0 66,877 1

Seq Scan on c_bpartner_location bpl_2 (cost=0.00..6,865.61 rows=66,861 width=12) (actual time=0.005..24.378 rows=66,877 loops=1)

115. 0.053 0.116 ↑ 1.0 220 1

Hash (cost=12.20..12.20 rows=220 width=10) (actual time=0.115..0.116 rows=220 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
116. 0.063 0.063 ↑ 1.0 220 1

Seq Scan on c_doctype d_2 (cost=0.00..12.20 rows=220 width=10) (actual time=0.003..0.063 rows=220 loops=1)

117. 6.589 6.589 ↑ 1.0 41,131 1

Index Only Scan using c_bpartner_pkey on c_bpartner b_2 (cost=0.29..749.71 rows=41,455 width=6) (actual time=0.015..6.589 rows=41,131 loops=1)

  • Heap Fetches: 7501
118. 0.228 0.228 ↑ 1.0 1 38

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_5 (cost=0.42..0.52 rows=1 width=6) (actual time=0.006..0.006 rows=1 loops=38)

  • Index Cond: (c_invoice_id = i_2.c_invoice_id)
  • Heap Fetches: 0
119. 11.231 11.231 ↑ 1.0 41,131 1

Index Scan using c_bpartner_pkey on c_bpartner bp_4 (cost=0.29..3,115.66 rows=41,455 width=29) (actual time=0.016..11.231 rows=41,131 loops=1)

120. 0.095 0.224 ↑ 1.0 426 1

Hash (cost=16.26..16.26 rows=426 width=15) (actual time=0.224..0.224 rows=426 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
121. 0.129 0.129 ↑ 1.0 426 1

Seq Scan on c_paymentterm p_1 (cost=0.00..16.26 rows=426 width=15) (actual time=0.004..0.129 rows=426 loops=1)

122. 0.304 0.304 ↑ 1.0 1 38

Index Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_4 (cost=0.42..1.53 rows=1 width=22) (actual time=0.007..0.008 rows=1 loops=38)

  • Index Cond: (c_invoice_id = i_2.c_invoice_id)
123. 0.380 0.380 ↑ 1.0 1 38

Index Scan using cof_titulo_c_invoice_id on cof_titulo t_4 (cost=0.42..1.95 rows=1 width=226) (actual time=0.010..0.010 rows=1 loops=38)

  • Index Cond: (c_invoice_id = i_2.c_invoice_id)
  • Filter: ((COALESCE(c_invoicepayschedule_id, '0'::numeric) = '0'::numeric) AND (isvalid = 'Y'::bpchar))
  • Rows Removed by Filter: 0
124. 0.004 0.014 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=30) (actual time=0.014..0.014 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
125. 0.010 0.010 ↑ 1.0 9 1

Seq Scan on cof_c_bankintegration bi_2 (cost=0.00..1.09 rows=9 width=30) (actual time=0.008..0.010 rows=9 loops=1)

126. 0.037 0.084 ↑ 1.0 171 1

Hash (cost=6.71..6.71 rows=171 width=50) (actual time=0.084..0.084 rows=171 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
127. 0.047 0.047 ↑ 1.0 171 1

Seq Scan on cof_c_bankoccurrence bo_2 (cost=0.00..6.71 rows=171 width=50) (actual time=0.005..0.047 rows=171 loops=1)

128. 0.006 0.016 ↑ 1.0 26 1

Hash (cost=1.26..1.26 rows=26 width=6) (actual time=0.016..0.016 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
129. 0.010 0.010 ↑ 1.0 26 1

Seq Scan on c_bp_group bpg_2 (cost=0.00..1.26 rows=26 width=6) (actual time=0.004..0.010 rows=26 loops=1)

130. 2.603 213,600.155 ↑ 24.3 1,589 1

Subquery Scan on *SELECT* 2_1 (cost=31,569.99..239,765.43 rows=38,579 width=1,272) (actual time=525.167..213,600.155 rows=1,589 loops=1)

131. 1,302.687 213,597.552 ↑ 24.3 1,589 1

Hash Left Join (cost=31,569.99..239,186.74 rows=38,579 width=1,244) (actual time=525.151..213,597.552 rows=1,589 loops=1)

  • Hash Cond: (bp_5.c_bp_group_id = bpg_3.c_bp_group_id)
132. 1.936 212,294.850 ↑ 24.3 1,589 1

Hash Left Join (cost=31,568.41..121,208.53 rows=38,579 width=927) (actual time=524.198..212,294.850 rows=1,589 loops=1)

  • Hash Cond: (t_5.cof_c_bankoccurrence_id = bo_3.cof_c_bankoccurrence_id)
133. 2.528 212,292.807 ↑ 24.3 1,589 1

Hash Left Join (cost=31,559.56..121,095.96 rows=38,579 width=884) (actual time=524.084..212,292.807 rows=1,589 loops=1)

  • Hash Cond: (t_5.cof_c_bankintegration_id = bi_3.cof_c_bankintegration_id)
134. 2.744 212,290.265 ↑ 24.3 1,589 1

Nested Loop Left Join (cost=31,558.36..120,945.79 rows=38,579 width=860) (actual time=524.062..212,290.265 rows=1,589 loops=1)

  • Join Filter: (t_5.c_invoice_id = i_3.c_invoice_id)
135. 5.791 212,274.809 ↑ 24.3 1,589 1

Nested Loop Left Join (cost=31,557.94..99,935.19 rows=38,579 width=640) (actual time=524.049..212,274.809 rows=1,589 loops=1)

136. 211,665.125 212,259.484 ↑ 24.3 1,589 1

Hash Join (cost=31,557.52..52,621.41 rows=38,579 width=624) (actual time=524.021..212,259.484 rows=1,589 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: 54353
137. 128.931 128.931 ↓ 1.0 267,568 1

Seq Scan on c_invoicepayschedule ips_1 (cost=0.00..9,882.86 rows=267,499 width=54) (actual time=0.007..128.931 rows=267,568 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 191
138. 35.319 465.428 ↑ 1.0 37,787 1

Hash (cost=31,077.26..31,077.26 rows=38,421 width=576) (actual time=465.428..465.428 rows=37,787 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 14291kB
139. 30.639 430.109 ↑ 1.0 37,787 1

Hash Left Join (cost=26,088.05..31,077.26 rows=38,421 width=576) (actual time=205.872..430.109 rows=37,787 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = bp_5.c_bpartner_id)
140. 24.892 375.134 ↑ 1.0 37,787 1

Hash Join (cost=22,810.31..27,698.65 rows=38,421 width=553) (actual time=181.448..375.134 rows=37,787 loops=1)

  • Hash Cond: (bpl_3.c_location_id = loc_3.c_location_id)
141. 25.472 324.828 ↑ 1.0 37,787 1

Hash Join (cost=20,212.81..25,000.29 rows=38,421 width=559) (actual time=155.874..324.828 rows=37,787 loops=1)

  • Hash Cond: (i_3.c_bpartner_location_id = bpl_3.c_bpartner_location_id)
142. 24.458 261.313 ↑ 1.0 37,787 1

Hash Join (cost=12,511.44..17,198.06 rows=38,421 width=553) (actual time=117.677..261.313 rows=37,787 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = b_3.c_bpartner_id)
143. 21.019 222.233 ↑ 1.0 37,787 1

Hash Join (cost=11,243.53..15,829.29 rows=38,421 width=553) (actual time=102.970..222.233 rows=37,787 loops=1)

  • Hash Cond: (i_3.c_doctype_id = d_3.c_doctype_id)
144. 72.878 201.105 ↑ 1.0 37,787 1

Hash Right Join (cost=11,228.58..15,711.54 rows=38,421 width=549) (actual time=102.851..201.105 rows=37,787 loops=1)

  • Hash Cond: (df_7.c_invoice_id = i_3.c_invoice_id)
145. 25.492 25.492 ↑ 1.0 215,752 1

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_7 (cost=0.42..3,916.93 rows=215,781 width=6) (actual time=0.023..25.492 rows=215,752 loops=1)

  • Heap Fetches: 2746
146. 27.769 102.735 ↑ 1.0 37,787 1

Hash (cost=10,747.90..10,747.90 rows=38,421 width=549) (actual time=102.735..102.735 rows=37,787 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 13241kB
147. 74.966 74.966 ↑ 1.0 37,787 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i_3 (cost=0.42..10,747.90 rows=38,421 width=549) (actual time=0.047..74.966 rows=37,787 loops=1)

  • Index Cond: ((ad_client_id = '1000001'::numeric) AND (ad_org_id = '1000003'::numeric))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ispayschedulevalid = 'Y'::bpchar) AND (issotrx = 'Y'::bpchar) AND (cof_composescashflow = 'Y'::bpchar))
  • Rows Removed by Filter: 24044
148. 0.041 0.109 ↑ 1.0 220 1

Hash (cost=12.20..12.20 rows=220 width=10) (actual time=0.109..0.109 rows=220 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
149. 0.068 0.068 ↑ 1.0 220 1

Seq Scan on c_doctype d_3 (cost=0.00..12.20 rows=220 width=10) (actual time=0.008..0.068 rows=220 loops=1)

150. 7.203 14.622 ↓ 1.0 41,462 1

Hash (cost=749.71..749.71 rows=41,455 width=6) (actual time=14.622..14.622 rows=41,462 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2092kB
151. 7.419 7.419 ↓ 1.0 41,462 1

Index Only Scan using c_bpartner_pkey on c_bpartner b_3 (cost=0.29..749.71 rows=41,455 width=6) (actual time=0.023..7.419 rows=41,462 loops=1)

  • Heap Fetches: 7709
152. 12.722 38.043 ↓ 1.0 66,877 1

Hash (cost=6,865.61..6,865.61 rows=66,861 width=12) (actual time=38.043..38.043 rows=66,877 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4029kB
153. 25.321 25.321 ↓ 1.0 66,877 1

Seq Scan on c_bpartner_location bpl_3 (cost=0.00..6,865.61 rows=66,861 width=12) (actual time=0.008..25.321 rows=66,877 loops=1)

154. 14.597 25.414 ↓ 1.0 85,062 1

Hash (cost=1,534.45..1,534.45 rows=85,044 width=6) (actual time=25.414..25.414 rows=85,062 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4264kB
155. 10.817 10.817 ↓ 1.0 85,062 1

Index Only Scan using c_location_pkey on c_location loc_3 (cost=0.29..1,534.45 rows=85,044 width=6) (actual time=0.037..10.817 rows=85,062 loops=1)

  • Heap Fetches: 941
156. 8.642 24.336 ↓ 1.0 41,462 1

Hash (cost=2,759.55..2,759.55 rows=41,455 width=29) (actual time=24.336..24.336 rows=41,462 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 3058kB
157. 15.694 15.694 ↓ 1.0 41,462 1

Seq Scan on c_bpartner bp_5 (cost=0.00..2,759.55 rows=41,455 width=29) (actual time=0.009..15.694 rows=41,462 loops=1)

158. 9.534 9.534 ↑ 1.0 1 1,589

Index Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_6 (cost=0.42..1.22 rows=1 width=22) (actual time=0.006..0.006 rows=1 loops=1,589)

  • Index Cond: (c_invoice_id = i_3.c_invoice_id)
159. 12.712 12.712 ↑ 1.0 1 1,589

Index Scan using cof_titulo_c_invoicepayschedule_id on cof_titulo t_5 (cost=0.42..0.53 rows=1 width=232) (actual time=0.007..0.008 rows=1 loops=1,589)

  • Index Cond: (c_invoicepayschedule_id = ips_1.c_invoicepayschedule_id)
  • Filter: (isvalid = 'Y'::bpchar)
160. 0.004 0.014 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=30) (actual time=0.014..0.014 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
161. 0.010 0.010 ↑ 1.0 9 1

Seq Scan on cof_c_bankintegration bi_3 (cost=0.00..1.09 rows=9 width=30) (actual time=0.007..0.010 rows=9 loops=1)

162. 0.048 0.107 ↑ 1.0 171 1

Hash (cost=6.71..6.71 rows=171 width=50) (actual time=0.107..0.107 rows=171 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
163. 0.059 0.059 ↑ 1.0 171 1

Seq Scan on cof_c_bankoccurrence bo_3 (cost=0.00..6.71 rows=171 width=50) (actual time=0.006..0.059 rows=171 loops=1)

164. 0.006 0.015 ↑ 1.0 26 1

Hash (cost=1.26..1.26 rows=26 width=6) (actual time=0.015..0.015 rows=26 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
165. 0.009 0.009 ↑ 1.0 26 1

Seq Scan on c_bp_group bpg_3 (cost=0.00..1.26 rows=26 width=6) (actual time=0.005..0.009 rows=26 loops=1)

166.          

SubPlan (forHash Left Join)

167. 0.000 0.000 ↑ 1.0 1 1,589

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

168. 36.021 225.311 ↓ 1.0 148,032 1

Hash (cost=23,934.49..23,934.49 rows=148,023 width=15) (actual time=225.311..225.311 rows=148,032 loops=1)

  • Buckets: 262144 Batches: 1 Memory Usage: 8911kB
169. 189.290 189.290 ↓ 1.0 148,032 1

Seq Scan on cof_titulo t_3 (cost=0.00..23,934.49 rows=148,023 width=15) (actual time=0.008..189.290 rows=148,032 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 11206
170. 0.003 0.014 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=22) (actual time=0.014..0.014 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
171. 0.011 0.011 ↑ 1.0 9 1

Seq Scan on cof_c_bankintegration bai (cost=0.00..1.09 rows=9 width=22) (actual time=0.007..0.011 rows=9 loops=1)

172. 0.018 0.037 ↑ 1.0 45 1

Hash (cost=2.45..2.45 rows=45 width=9) (actual time=0.037..0.037 rows=45 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
173. 0.019 0.019 ↑ 1.0 45 1

Seq Scan on cof_c_custody cu (cost=0.00..2.45 rows=45 width=9) (actual time=0.003..0.019 rows=45 loops=1)

174. 0.011 0.011 ↑ 1.0 1 1

Index Scan using c_bpartner_pkey on c_bpartner bp_3 (cost=0.29..0.37 rows=1 width=34) (actual time=0.011..0.011 rows=1 loops=1)

  • Index Cond: ("*SELECT* 1_1".c_bpartner_id = c_bpartner_id)
175. 0.175 0.477 ↑ 1.0 963 1

Hash (cost=37.63..37.63 rows=963 width=29) (actual time=0.477..0.477 rows=963 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 67kB
176. 0.302 0.302 ↑ 1.0 963 1

Seq Scan on c_elementvalue u1_1 (cost=0.00..37.63 rows=963 width=29) (actual time=0.008..0.302 rows=963 loops=1)

177. 0.006 0.015 ↑ 1.0 21 1

Hash (cost=1.21..1.21 rows=21 width=22) (actual time=0.015..0.015 rows=21 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
178. 0.009 0.009 ↑ 1.0 21 1

Seq Scan on c_activity ac_1 (cost=0.00..1.21 rows=21 width=22) (actual time=0.003..0.009 rows=21 loops=1)

179. 0.001 0.005 ↑ 1.0 1 1

Hash (cost=1.01..1.01 rows=1 width=17) (actual time=0.005..0.005 rows=1 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
180. 0.004 0.004 ↑ 1.0 1 1

Seq Scan on cof_c_planofinanceiro pf_1 (cost=0.00..1.01 rows=1 width=17) (actual time=0.004..0.004 rows=1 loops=1)

181. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=235) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: false
182. 0.000 0.000 ↓ 0.0 0 1

Result (cost=0.00..0.00 rows=0 width=235) (actual time=0.000..0.000 rows=0 loops=1)

  • One-Time Filter: false
183. 0.000 0.034 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,615.67..12,452.88 rows=1 width=258) (actual time=0.034..0.034 rows=0 loops=1)

184. 0.000 0.034 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,615.53..12,452.26 rows=1 width=148) (actual time=0.034..0.034 rows=0 loops=1)

185. 0.000 0.034 ↓ 0.0 0 1

Nested Loop Left Join (cost=5,615.25..12,450.81 rows=1 width=132) (actual time=0.034..0.034 rows=0 loops=1)

186. 0.001 0.034 ↓ 0.0 0 1

Nested Loop (cost=5,614.96..12,448.36 rows=1 width=111) (actual time=0.034..0.034 rows=0 loops=1)

187. 0.033 0.033 ↓ 0.0 0 1

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

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

Bitmap Heap Scan on c_payment (cost=5,614.96..12,444.14 rows=1 width=117) (never executed)

  • Recheck Cond: ((c_bankaccount_id = ba.c_bankaccount_id) AND (ad_org_id = '1000003'::numeric) AND (ad_client_id = '1000001'::numeric))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (isreceipt = 'Y'::bpchar) AND (isallocated = 'Y'::bpchar) AND (datetrx = '2019-03-27'::date) AND ((SubPlan 1) <= 0))
189. 0.000 0.000 ↓ 0.0 0

BitmapAnd (cost=5,614.96..5,614.96 rows=1,097 width=0) (never executed)

190. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on c_payment_bankaccount (cost=0.00..47.56 rows=4,378 width=0) (never executed)

  • Index Cond: (c_bankaccount_id = ba.c_bankaccount_id)
191. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_c_payment_createdby_ad_org_ad_client (cost=0.00..5,567.15 rows=89,990 width=0) (never executed)

  • Index Cond: ((ad_org_id = '1000003'::numeric) AND (ad_client_id = '1000001'::numeric))
192.          

SubPlan (forBitmap Heap Scan)

193. 0.000 0.000 ↓ 0.0 0

Aggregate (cost=5.15..5.16 rows=1 width=8) (never executed)

194. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.71..5.15 rows=1 width=6) (never executed)

195. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_c_bankstatementline_c_payment_id on c_bankstatementline bsl (cost=0.42..2.64 rows=1 width=12) (never executed)

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

Index Scan using c_bankstatement_pkey on c_bankstatement bs (cost=0.29..2.51 rows=1 width=6) (never executed)

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

Index Scan using c_bpartner_pkey on c_bpartner bp_6 (cost=0.29..2.45 rows=1 width=34) (never executed)

  • Index Cond: (c_bpartner_id = c_payment.c_bpartner_id)
198. 0.000 0.000 ↓ 0.0 0

Index Scan using c_elementvalue_pkey on c_elementvalue u1_2 (cost=0.28..1.45 rows=1 width=29) (never executed)

  • Index Cond: (c_elementvalue_id = c_payment.user1_id)
199. 0.000 0.000 ↓ 0.0 0

Index Scan using c_activity_pkey on c_activity ac_2 (cost=0.14..0.34 rows=1 width=22) (never executed)

  • Index Cond: (c_payment.c_activity_id = c_activity_id)
200. 0.000 2.193 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.99..340.30 rows=1 width=258) (actual time=2.193..2.193 rows=0 loops=1)

  • Join Filter: (p_2.c_activity_id = ac_3.c_activity_id)
201. 0.001 2.193 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.99..338.82 rows=1 width=127) (actual time=2.193..2.193 rows=0 loops=1)

202. 0.000 2.192 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.71..336.33 rows=1 width=111) (actual time=2.192..2.192 rows=0 loops=1)

203. 0.000 2.192 ↓ 0.0 0 1

Nested Loop (cost=0.42..334.22 rows=1 width=90) (actual time=2.192..2.192 rows=0 loops=1)

204. 2.192 2.192 ↓ 0.0 0 1

Seq Scan on cof_c_controlcheck cc (cost=0.00..331.54 rows=1 width=33) (actual time=2.192..2.192 rows=0 loops=1)

  • Filter: ((changedate IS NULL) AND (cof_dateresubmit2 IS NULL) AND (dateto = '2019-03-27'::date) AND (ad_client_id = '1000001'::numeric) AND (ad_org_id = '1000003'::numeric))
  • Rows Removed by Filter: 6146
205. 0.000 0.000 ↓ 0.0 0

Index Scan using c_payment_pkey on c_payment p_2 (cost=0.42..2.65 rows=1 width=70) (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))
206. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_pkey on c_bpartner bp_7 (cost=0.29..2.10 rows=1 width=34) (never executed)

  • Index Cond: (c_bpartner_id = p_2.c_bpartner_id)
207. 0.000 0.000 ↓ 0.0 0

Index Scan using c_elementvalue_pkey on c_elementvalue u1_3 (cost=0.28..2.49 rows=1 width=29) (never executed)

  • Index Cond: (c_elementvalue_id = cc.user1_id)
208. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_activity ac_3 (cost=0.00..1.21 rows=21 width=22) (never executed)