explain.depesz.com

PostgreSQL's explain analyze made readable

Result: wzJ

Settings
# exclusive inclusive rows x rows loops node
1. 0.005 135,156.501 ↑ 112.0 2 1

Append (cost=138,858.58..526,755.19 rows=224 width=795) (actual time=19,877.255..135,156.501 rows=2 loops=1)

2. 0.011 19,877.734 ↑ 47.0 1 1

Hash Left Join (cost=138,858.58..139,462.86 rows=47 width=800) (actual time=19,877.254..19,877.734 rows=1 loops=1)

  • Hash Cond: (oi.cof_c_planofinanceiro_id = pf.cof_c_planofinanceiro_id)
3. 0.006 19,877.718 ↑ 47.0 1 1

Hash Left Join (cost=138,857.55..139,449.97 rows=47 width=772) (actual time=19,877.238..19,877.718 rows=1 loops=1)

  • Hash Cond: (oi.c_activity_id = ac.c_activity_id)
4. 0.003 19,877.696 ↑ 47.0 1 1

Nested Loop Left Join (cost=138,856.08..139,448.37 rows=47 width=773) (actual time=19,877.216..19,877.696 rows=1 loops=1)

5. 0.005 19,877.685 ↑ 47.0 1 1

Nested Loop Left Join (cost=138,855.81..139,407.54 rows=47 width=766) (actual time=19,877.205..19,877.685 rows=1 loops=1)

6. 0.003 19,877.670 ↑ 47.0 1 1

Nested Loop Left Join (cost=138,855.52..139,300.36 rows=47 width=754) (actual time=19,877.191..19,877.670 rows=1 loops=1)

  • Filter: ((t.cof_billfoldtype IS NULL) OR ((t.cof_billfoldtype)::text = 'CS'::text))
7. 0.065 19,877.665 ↑ 63.0 1 1

Subquery Scan on oi (cost=138,855.10..139,137.81 rows=63 width=770) (actual time=19,877.186..19,877.665 rows=1 loops=1)

  • Filter: (oi.duedate = '2019-03-27'::date)
  • Rows Removed by Filter: 632
8. 5.811 19,877.600 ↑ 19.8 633 1

HashAggregate (cost=138,855.10..138,980.75 rows=12,565 width=3,648) (actual time=19,876.701..19,877.600 rows=633 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
9. 0.166 19,871.789 ↑ 19.8 633 1

Append (cost=49.94..135,336.90 rows=12,565 width=3,648) (actual time=2,899.057..19,871.789 rows=633 loops=1)

10. 0.001 463.739 ↓ 0.0 0 1

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

11. 0.000 463.738 ↓ 0.0 0 1

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

  • Hash Cond: (bp_1.c_bp_group_id = bpg.c_bp_group_id)
12. 0.001 463.738 ↓ 0.0 0 1

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

13. 0.000 463.737 ↓ 0.0 0 1

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

  • Hash Cond: (t_1.cof_c_bankoccurrence_id = bo.cof_c_bankoccurrence_id)
14. 0.001 463.737 ↓ 0.0 0 1

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

  • Join Filter: (bi.cof_c_bankintegration_id = t_1.cof_c_bankintegration_id)
15. 0.000 463.736 ↓ 0.0 0 1

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

16. 0.001 463.736 ↓ 0.0 0 1

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

17. 0.006 463.735 ↓ 0.0 0 1

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

  • Hash Cond: (i.c_paymentterm_id = p.c_paymentterm_id)
18. 0.000 463.451 ↓ 0.0 0 1

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

19. 0.001 463.451 ↓ 0.0 0 1

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

20. 0.000 463.450 ↓ 0.0 0 1

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

21. 0.001 463.450 ↓ 0.0 0 1

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

22. 0.001 463.449 ↓ 0.0 0 1

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

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
23. 463.448 463.448 ↓ 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=463.448..463.448 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: 10430
24. 0.000 0.000 ↓ 0.0 0

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

25. 0.000 0.000 ↓ 0.0 0

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

26. 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
27. 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)
28. 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
29. 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
30. 0.100 0.278 ↑ 1.0 426 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
31. 0.178 0.178 ↑ 1.0 426 1

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

32. 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)
33. 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))
34. 0.000 0.000 ↓ 0.0 0

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

35. 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)

36. 0.000 0.000 ↓ 0.0 0

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

37. 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)

38. 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)
39. 0.000 0.000 ↓ 0.0 0

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

40. 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)

41. 1.012 19,407.884 ↑ 16.4 633 1

Subquery Scan on *SELECT* 2 (cost=28,228.07..94,959.15 rows=10,373 width=1,272) (actual time=2,435.317..19,407.884 rows=633 loops=1)

42. 1,515.211 19,406.872 ↑ 16.4 633 1

Hash Left Join (cost=28,228.07..94,803.56 rows=10,373 width=1,244) (actual time=2,435.314..19,406.872 rows=633 loops=1)

  • Hash Cond: (bp_2.c_bp_group_id = bpg_1.c_bp_group_id)
43. 0.476 17,891.649 ↑ 16.4 633 1

Hash Left Join (cost=28,226.48..63,080.79 rows=10,373 width=927) (actual time=2,434.233..17,891.649 rows=633 loops=1)

  • Hash Cond: (t_2.cof_c_bankoccurrence_id = bo_1.cof_c_bankoccurrence_id)
44. 0.657 17,891.096 ↑ 16.4 633 1

Hash Left Join (cost=28,217.64..63,044.06 rows=10,373 width=884) (actual time=2,434.152..17,891.096 rows=633 loops=1)

  • Hash Cond: (t_2.cof_c_bankintegration_id = bi_1.cof_c_bankintegration_id)
45. 0.586 17,890.429 ↑ 16.4 633 1

Nested Loop Left Join (cost=28,216.43..63,002.80 rows=10,373 width=860) (actual time=2,434.135..17,890.429 rows=633 loops=1)

  • Join Filter: (t_2.c_invoice_id = i_1.c_invoice_id)
46. 1.210 17,886.678 ↑ 16.4 633 1

Nested Loop Left Join (cost=28,216.01..57,353.53 rows=10,373 width=640) (actual time=2,434.109..17,886.678 rows=633 loops=1)

47. 17,601.775 17,882.303 ↑ 16.4 633 1

Hash Join (cost=28,215.59..41,838.14 rows=10,373 width=624) (actual time=2,434.096..17,882.303 rows=633 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
48. 77.246 77.246 ↓ 1.0 267,621 1

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

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 191
49. 6.003 203.282 ↑ 1.2 8,581 1

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

  • Buckets: 16384 Batches: 1 Memory Usage: 3386kB
50. 4.745 197.279 ↑ 1.2 8,581 1

Hash Left Join (cost=26,048.22..28,086.47 rows=10,330 width=576) (actual time=160.037..197.279 rows=8,581 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = bp_2.c_bpartner_id)
51. 4.332 170.863 ↑ 1.2 8,581 1

Hash Join (cost=22,770.49..24,781.62 rows=10,330 width=553) (actual time=138.281..170.863 rows=8,581 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = b_1.c_bpartner_id)
52. 4.186 152.532 ↑ 1.2 8,581 1

Hash Join (cost=21,502.58..23,486.60 rows=10,330 width=553) (actual time=124.207..152.532 rows=8,581 loops=1)

  • Hash Cond: (i_1.c_doctype_id = d_1.c_doctype_id)
53. 16.073 148.257 ↑ 1.2 8,581 1

Hash Join (cost=21,487.63..23,444.01 rows=10,330 width=549) (actual time=124.106..148.257 rows=8,581 loops=1)

  • Hash Cond: (loc_1.c_location_id = bpl_1.c_location_id)
54. 8.132 8.132 ↓ 1.0 85,082 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.018..8.132 rows=85,082 loops=1)

  • Heap Fetches: 1066
55. 6.413 124.052 ↑ 1.2 8,581 1

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

  • Buckets: 16384 Batches: 1 Memory Usage: 3198kB
56. 5.428 117.639 ↑ 1.2 8,581 1

Hash Join (cost=16,848.15..21,358.22 rows=10,330 width=555) (actual time=59.361..117.639 rows=8,581 loops=1)

  • Hash Cond: (i_1.c_bpartner_location_id = bpl_1.c_bpartner_location_id)
57. 30.811 80.661 ↑ 1.2 8,581 1

Hash Right Join (cost=9,146.78..13,629.73 rows=10,330 width=549) (actual time=27.666..80.661 rows=8,581 loops=1)

  • Hash Cond: (df_3.c_invoice_id = i_1.c_invoice_id)
58. 22.355 22.355 ↑ 1.0 215,778 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.021..22.355 rows=215,778 loops=1)

  • Heap Fetches: 4752
59. 5.801 27.495 ↑ 1.2 8,580 1

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

  • Buckets: 16384 Batches: 1 Memory Usage: 3139kB
60. 21.694 21.694 ↑ 1.2 8,580 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.313..21.694 rows=8,580 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
61. 10.812 31.550 ↓ 1.0 66,896 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 4030kB
62. 20.738 20.738 ↓ 1.0 66,896 1

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

63. 0.036 0.089 ↑ 1.0 220 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
64. 0.053 0.053 ↑ 1.0 220 1

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

65. 6.699 13.999 ↓ 1.0 41,472 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 2092kB
66. 7.300 7.300 ↓ 1.0 41,472 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.016..7.300 rows=41,472 loops=1)

  • Heap Fetches: 9670
67. 7.608 21.671 ↓ 1.0 41,472 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 3059kB
68. 14.063 14.063 ↓ 1.0 41,472 1

Seq Scan on c_bpartner bp_2 (cost=0.00..2,759.55 rows=41,455 width=29) (actual time=0.010..14.063 rows=41,472 loops=1)

69. 3.165 3.165 ↓ 0.0 0 633

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.004..0.005 rows=0 loops=633)

  • Index Cond: (c_invoice_id = i_1.c_invoice_id)
70. 3.165 3.165 ↓ 0.0 0 633

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.005..0.005 rows=0 loops=633)

  • Index Cond: (c_invoicepayschedule_id = ips.c_invoicepayschedule_id)
  • Filter: (isvalid = 'Y'::bpchar)
71. 0.003 0.010 ↑ 1.0 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
72. 0.007 0.007 ↑ 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.007 rows=9 loops=1)

73. 0.035 0.077 ↑ 1.0 171 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
74. 0.042 0.042 ↑ 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.042 rows=171 loops=1)

75. 0.005 0.012 ↑ 1.0 26 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
76. 0.007 0.007 ↑ 1.0 26 1

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

77.          

SubPlan (forHash Left Join)

78. 0.000 0.000 ↑ 1.0 1 633

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

79. 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)
80. 0.010 0.010 ↑ 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.010..0.010 rows=1 loops=1)

  • Index Cond: (c_bpartner_id = oi.c_bpartner_id)
81. 0.008 0.008 ↑ 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.008..0.008 rows=1 loops=1)

  • Index Cond: (c_elementvalue_id = oi.user1_id)
82. 0.006 0.016 ↑ 1.0 21 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
83. 0.010 0.010 ↑ 1.0 21 1

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

84. 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
85. 0.004 0.004 ↑ 1.0 1 1

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

86. 0.055 115,278.687 ↑ 175.0 1 1

Hash Left Join (cost=385,792.18..387,190.87 rows=175 width=800) (actual time=115,275.085..115,278.687 rows=1 loops=1)

  • Hash Cond: ("*SELECT* 1_1".cof_c_planofinanceiro_id = pf_1.cof_c_planofinanceiro_id)
87. 0.012 115,278.621 ↑ 175.0 1 1

Hash Left Join (cost=385,791.16..387,145.63 rows=175 width=772) (actual time=115,275.020..115,278.621 rows=1 loops=1)

  • Hash Cond: ("*SELECT* 1_1".c_activity_id = ac_1.c_activity_id)
88. 0.014 115,278.590 ↑ 175.0 1 1

Hash Left Join (cost=385,789.69..387,143.68 rows=175 width=773) (actual time=115,274.988..115,278.590 rows=1 loops=1)

  • Hash Cond: ("*SELECT* 1_1".user1_id = u1_1.c_elementvalue_id)
89. 0.014 115,278.212 ↑ 175.0 1 1

Nested Loop Left Join (cost=385,740.02..387,093.56 rows=175 width=766) (actual time=115,274.611..115,278.212 rows=1 loops=1)

90. 0.772 115,278.171 ↑ 175.0 1 1

Hash Left Join (cost=385,739.73..387,029.61 rows=175 width=754) (actual time=115,274.571..115,278.171 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: 1634
91. 0.538 115,277.366 ↑ 21.4 1,635 1

Hash Left Join (cost=385,736.72..386,929.22 rows=35,020 width=794) (actual time=115,272.766..115,277.366 rows=1,635 loops=1)

  • Hash Cond: (t_3.cof_c_bankintegration_id = bai.cof_c_bankintegration_id)
92. 1.104 115,276.803 ↑ 21.4 1,635 1

Hash Left Join (cost=385,735.51..386,792.80 rows=35,020 width=784) (actual time=115,272.694..115,276.803 rows=1,635 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
93. 18.705 115,097.307 ↑ 28.5 1,637 1

HashAggregate (cost=359,950.74..360,418.05 rows=46,731 width=3,648) (actual time=115,094.028..115,097.307 rows=1,637 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
94. 0.441 115,078.602 ↑ 28.5 1,637 1

Append (cost=36,634.73..346,866.06 rows=46,731 width=3,648) (actual time=9,146.007..115,078.602 rows=1,637 loops=1)

95. 0.044 9,204.365 ↑ 209.0 39 1

Subquery Scan on *SELECT* 1_1 (cost=36,634.73..107,100.63 rows=8,152 width=1,343) (actual time=9,146.004..9,204.365 rows=39 loops=1)

96. 31.673 9,204.321 ↑ 209.0 39 1

Hash Left Join (cost=36,634.73..106,998.73 rows=8,152 width=1,339) (actual time=9,145.997..9,204.321 rows=39 loops=1)

  • Hash Cond: (bp_4.c_bp_group_id = bpg_2.c_bp_group_id)
97. 0.045 9,172.631 ↑ 209.0 39 1

Hash Left Join (cost=36,633.15..73,834.38 rows=8,152 width=895) (actual time=9,144.834..9,172.631 rows=39 loops=1)

  • Hash Cond: (t_4.cof_c_bankoccurrence_id = bo_2.cof_c_bankoccurrence_id)
98. 0.051 9,172.507 ↑ 209.0 39 1

Hash Left Join (cost=36,624.30..73,803.61 rows=8,152 width=852) (actual time=9,144.742..9,172.507 rows=39 loops=1)

  • Hash Cond: (t_4.cof_c_bankintegration_id = bi_2.cof_c_bankintegration_id)
99. 0.060 9,172.438 ↑ 209.0 39 1

Nested Loop Left Join (cost=36,623.10..73,770.93 rows=8,152 width=828) (actual time=9,144.710..9,172.438 rows=39 loops=1)

100. 0.107 9,171.988 ↑ 209.0 39 1

Nested Loop Left Join (cost=36,622.68..57,784.52 rows=8,152 width=608) (actual time=9,144.688..9,171.988 rows=39 loops=1)

101. 0.066 9,171.725 ↑ 209.0 39 1

Hash Join (cost=36,622.26..45,262.80 rows=8,152 width=592) (actual time=9,144.671..9,171.725 rows=39 loops=1)

  • Hash Cond: (i_2.c_paymentterm_id = p_1.c_paymentterm_id)
102. 6.479 9,171.474 ↑ 209.0 39 1

Merge Left Join (cost=36,600.67..45,219.61 rows=8,152 width=583) (actual time=9,144.472..9,171.474 rows=39 loops=1)

  • Merge Cond: (i_2.c_bpartner_id = bp_4.c_bpartner_id)
103. 0.073 9,155.048 ↑ 209.0 39 1

Nested Loop Left Join (cost=36,600.07..41,901.83 rows=8,152 width=560) (actual time=9,144.343..9,155.048 rows=39 loops=1)

104. 4.367 9,154.780 ↑ 209.0 39 1

Merge Join (cost=36,599.65..37,574.01 rows=8,152 width=560) (actual time=9,144.315..9,154.780 rows=39 loops=1)

  • Merge Cond: (i_2.c_bpartner_id = b_2.c_bpartner_id)
105. 0.065 9,144.228 ↑ 209.0 39 1

Sort (cost=36,599.28..36,619.66 rows=8,152 width=560) (actual time=9,144.216..9,144.228 rows=39 loops=1)

  • Sort Key: i_2.c_bpartner_id
  • Sort Method: quicksort Memory: 45kB
106. 0.036 9,144.163 ↑ 209.0 39 1

Hash Join (cost=34,113.28..36,069.69 rows=8,152 width=560) (actual time=9,128.243..9,144.163 rows=39 loops=1)

  • Hash Cond: (i_2.c_doctype_id = d_2.c_doctype_id)
107. 8.238 9,144.039 ↑ 209.0 39 1

Hash Join (cost=34,098.33..36,032.93 rows=8,152 width=556) (actual time=9,128.142..9,144.039 rows=39 loops=1)

  • Hash Cond: (loc_2.c_location_id = bpl_2.c_location_id)
108. 7.784 7.784 ↓ 1.0 85,082 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.019..7.784 rows=85,082 loops=1)

  • Heap Fetches: 1066
109. 0.113 9,128.017 ↑ 209.0 39 1

Hash (cost=33,996.14..33,996.14 rows=8,152 width=562) (actual time=9,128.017..9,128.017 rows=39 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 78kB
110. 0.219 9,127.904 ↑ 209.0 39 1

Hash Join (cost=7,701.79..33,996.14 rows=8,152 width=562) (actual time=32.909..9,127.904 rows=39 loops=1)

  • Hash Cond: (i_2.c_bpartner_location_id = bpl_2.c_bpartner_location_id)
111. 9,095.367 9,095.367 ↑ 209.0 39 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=0.473..9,095.367 rows=39 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: 61802
112. 10.886 32.318 ↓ 1.0 66,896 1

Hash (cost=6,865.61..6,865.61 rows=66,861 width=12) (actual time=32.317..32.318 rows=66,896 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 4030kB
113. 21.432 21.432 ↓ 1.0 66,896 1

Seq Scan on c_bpartner_location bpl_2 (cost=0.00..6,865.61 rows=66,861 width=12) (actual time=0.007..21.432 rows=66,896 loops=1)

114. 0.036 0.088 ↑ 1.0 220 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
115. 0.052 0.052 ↑ 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.052 rows=220 loops=1)

116. 6.185 6.185 ↑ 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.023..6.185 rows=41,131 loops=1)

  • Heap Fetches: 9422
117. 0.195 0.195 ↑ 1.0 1 39

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.005..0.005 rows=1 loops=39)

  • Index Cond: (c_invoice_id = i_2.c_invoice_id)
  • Heap Fetches: 1
118. 9.947 9.947 ↑ 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.007..9.947 rows=41,131 loops=1)

119. 0.074 0.185 ↑ 1.0 426 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 29kB
120. 0.111 0.111 ↑ 1.0 426 1

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

121. 0.156 0.156 ↑ 1.0 1 39

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.003..0.004 rows=1 loops=39)

  • Index Cond: (c_invoice_id = i_2.c_invoice_id)
122. 0.390 0.390 ↑ 1.0 1 39

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=39)

  • 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
123. 0.004 0.018 ↑ 1.0 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
124. 0.014 0.014 ↑ 1.0 9 1

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

125. 0.033 0.079 ↑ 1.0 171 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
126. 0.046 0.046 ↑ 1.0 171 1

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

127. 0.005 0.017 ↑ 1.0 26 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
128. 0.012 0.012 ↑ 1.0 26 1

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

129. 2.447 105,873.796 ↑ 24.1 1,598 1

Subquery Scan on *SELECT* 2_1 (cost=31,569.99..239,765.43 rows=38,579 width=1,272) (actual time=1,036.470..105,873.796 rows=1,598 loops=1)

130. 1,550.776 105,871.349 ↑ 24.1 1,598 1

Hash Left Join (cost=31,569.99..239,186.74 rows=38,579 width=1,244) (actual time=1,036.461..105,871.349 rows=1,598 loops=1)

  • Hash Cond: (bp_5.c_bp_group_id = bpg_3.c_bp_group_id)
131. 1.883 104,320.560 ↑ 24.1 1,598 1

Hash Left Join (cost=31,568.41..121,208.53 rows=38,579 width=927) (actual time=1,035.627..104,320.560 rows=1,598 loops=1)

  • Hash Cond: (t_5.cof_c_bankoccurrence_id = bo_3.cof_c_bankoccurrence_id)
132. 2.324 104,318.598 ↑ 24.1 1,598 1

Hash Left Join (cost=31,559.56..121,095.96 rows=38,579 width=884) (actual time=1,035.538..104,318.598 rows=1,598 loops=1)

  • Hash Cond: (t_5.cof_c_bankintegration_id = bi_3.cof_c_bankintegration_id)
133. 3.225 104,316.264 ↑ 24.1 1,598 1

Nested Loop Left Join (cost=31,558.36..120,945.79 rows=38,579 width=860) (actual time=1,035.515..104,316.264 rows=1,598 loops=1)

  • Join Filter: (t_5.c_invoice_id = i_3.c_invoice_id)
134. 4.957 104,303.451 ↑ 24.1 1,598 1

Nested Loop Left Join (cost=31,557.94..99,935.19 rows=38,579 width=640) (actual time=1,035.493..104,303.451 rows=1,598 loops=1)

135. 103,755.316 104,290.504 ↑ 24.1 1,598 1

Hash Join (cost=31,557.52..52,621.41 rows=38,579 width=624) (actual time=1,035.468..104,290.504 rows=1,598 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
136. 119.738 119.738 ↓ 1.0 267,621 1

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

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 191
137. 34.868 415.450 ↑ 1.0 37,794 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 14293kB
138. 27.016 380.582 ↑ 1.0 37,794 1

Hash Left Join (cost=26,088.05..31,077.26 rows=38,421 width=576) (actual time=182.625..380.582 rows=37,794 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = bp_5.c_bpartner_id)
139. 21.771 332.157 ↑ 1.0 37,794 1

Hash Join (cost=22,810.31..27,698.65 rows=38,421 width=553) (actual time=161.116..332.157 rows=37,794 loops=1)

  • Hash Cond: (bpl_3.c_location_id = loc_3.c_location_id)
140. 22.195 288.561 ↑ 1.0 37,794 1

Hash Join (cost=20,212.81..25,000.29 rows=38,421 width=559) (actual time=139.141..288.561 rows=37,794 loops=1)

  • Hash Cond: (i_3.c_bpartner_location_id = bpl_3.c_bpartner_location_id)
141. 21.029 233.913 ↑ 1.0 37,794 1

Hash Join (cost=12,511.44..17,198.06 rows=38,421 width=553) (actual time=106.531..233.913 rows=37,794 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = b_3.c_bpartner_id)
142. 18.646 199.655 ↑ 1.0 37,794 1

Hash Join (cost=11,243.53..15,829.29 rows=38,421 width=553) (actual time=93.204..199.655 rows=37,794 loops=1)

  • Hash Cond: (i_3.c_doctype_id = d_3.c_doctype_id)
143. 65.467 180.916 ↑ 1.0 37,794 1

Hash Right Join (cost=11,228.58..15,711.54 rows=38,421 width=549) (actual time=93.092..180.916 rows=37,794 loops=1)

  • Hash Cond: (df_7.c_invoice_id = i_3.c_invoice_id)
144. 22.482 22.482 ↑ 1.0 215,778 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.029..22.482 rows=215,778 loops=1)

  • Heap Fetches: 4752
145. 25.506 92.967 ↑ 1.0 37,794 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 13243kB
146. 67.461 67.461 ↑ 1.0 37,794 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.045..67.461 rows=37,794 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: 24047
147. 0.036 0.093 ↑ 1.0 220 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
148. 0.057 0.057 ↑ 1.0 220 1

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

149. 6.224 13.229 ↓ 1.0 41,472 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 2092kB
150. 7.005 7.005 ↓ 1.0 41,472 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.005 rows=41,472 loops=1)

  • Heap Fetches: 9670
151. 10.987 32.453 ↓ 1.0 66,896 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 4030kB
152. 21.466 21.466 ↓ 1.0 66,896 1

Seq Scan on c_bpartner_location bpl_3 (cost=0.00..6,865.61 rows=66,861 width=12) (actual time=0.009..21.466 rows=66,896 loops=1)

153. 12.633 21.825 ↓ 1.0 85,082 1

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

  • Buckets: 131072 Batches: 1 Memory Usage: 4265kB
154. 9.192 9.192 ↓ 1.0 85,082 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.021..9.192 rows=85,082 loops=1)

  • Heap Fetches: 1066
155. 7.545 21.409 ↓ 1.0 41,472 1

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

  • Buckets: 65536 Batches: 1 Memory Usage: 3059kB
156. 13.864 13.864 ↓ 1.0 41,472 1

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

157. 7.990 7.990 ↑ 1.0 1 1,598

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.004..0.005 rows=1 loops=1,598)

  • Index Cond: (c_invoice_id = i_3.c_invoice_id)
158. 9.588 9.588 ↑ 1.0 1 1,598

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.006..0.006 rows=1 loops=1,598)

  • Index Cond: (c_invoicepayschedule_id = ips_1.c_invoicepayschedule_id)
  • Filter: (isvalid = 'Y'::bpchar)
159. 0.003 0.010 ↑ 1.0 9 1

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

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

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

161. 0.035 0.079 ↑ 1.0 171 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 22kB
162. 0.044 0.044 ↑ 1.0 171 1

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

163. 0.005 0.013 ↑ 1.0 26 1

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

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

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

165.          

SubPlan (forHash Left Join)

166. 0.000 0.000 ↑ 1.0 1 1,598

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

167. 34.572 178.392 ↓ 1.0 148,040 1

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

  • Buckets: 262144 Batches: 1 Memory Usage: 8911kB
168. 143.820 143.820 ↓ 1.0 148,040 1

Seq Scan on cof_titulo t_3 (cost=0.00..23,934.49 rows=148,023 width=15) (actual time=0.010..143.820 rows=148,040 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 11208
169. 0.004 0.025 ↑ 1.0 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
170. 0.021 0.021 ↑ 1.0 9 1

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

171. 0.008 0.033 ↑ 1.0 45 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
172. 0.025 0.025 ↑ 1.0 45 1

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

173. 0.027 0.027 ↑ 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.027..0.027 rows=1 loops=1)

  • Index Cond: ("*SELECT* 1_1".c_bpartner_id = c_bpartner_id)
174. 0.158 0.364 ↑ 1.0 963 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 67kB
175. 0.206 0.206 ↑ 1.0 963 1

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

176. 0.005 0.019 ↑ 1.0 21 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
177. 0.014 0.014 ↑ 1.0 21 1

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

178. 0.003 0.011 ↑ 1.0 1 1

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

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

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

180. 0.002 0.041 ↓ 0.0 0 1

Nested Loop Left Join (cost=52.45..85.64 rows=1 width=258) (actual time=0.041..0.041 rows=0 loops=1)

181. 0.002 0.039 ↓ 0.0 0 1

Nested Loop Left Join (cost=52.31..85.03 rows=1 width=148) (actual time=0.039..0.039 rows=0 loops=1)

182. 0.001 0.037 ↓ 0.0 0 1

Nested Loop Left Join (cost=52.04..83.57 rows=1 width=132) (actual time=0.037..0.037 rows=0 loops=1)

183. 0.001 0.036 ↓ 0.0 0 1

Nested Loop (cost=51.75..81.13 rows=1 width=111) (actual time=0.036..0.036 rows=0 loops=1)

184. 0.035 0.035 ↓ 0.0 0 1

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

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

Bitmap Heap Scan on c_payment (cost=51.75..76.90 rows=1 width=117) (never executed)

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

BitmapAnd (cost=51.75..51.75 rows=4 width=0) (never executed)

187. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_c_payment_datetrx (cost=0.00..3.89 rows=316 width=0) (never executed)

  • Index Cond: (datetrx = '2019-03-27'::date)
188. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_bankaccount_id = ba.c_bankaccount_id)
189.          

SubPlan (forBitmap Heap Scan)

190. 0.000 0.000 ↓ 0.0 0

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

191. 0.000 0.000 ↓ 0.0 0

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

192. 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)
193. 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[]))
194. 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)
195. 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)
196. 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)
197. 0.002 0.034 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.41..13.57 rows=1 width=258) (actual time=0.034..0.034 rows=0 loops=1)

198. 0.001 0.032 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.27..13.38 rows=1 width=127) (actual time=0.032..0.032 rows=0 loops=1)

199. 0.002 0.031 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.99..10.88 rows=1 width=111) (actual time=0.030..0.031 rows=0 loops=1)

200. 0.001 0.029 ↓ 0.0 0 1

Nested Loop (cost=0.70..8.78 rows=1 width=90) (actual time=0.029..0.029 rows=0 loops=1)

201. 0.028 0.028 ↓ 0.0 0 1

Index Scan using idx_cof_c_controlcheck_dateto on cof_c_controlcheck cc (cost=0.28..6.10 rows=1 width=33) (actual time=0.028..0.028 rows=0 loops=1)

  • Index Cond: (dateto = '2019-03-27'::date)
  • Filter: ((changedate IS NULL) AND (cof_dateresubmit2 IS NULL) AND (ad_client_id = '1000001'::numeric) AND (ad_org_id = '1000003'::numeric))
202. 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))
203. 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)
204. 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)
205. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (p_2.c_activity_id = c_activity_id)