explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IiVC

Settings
# exclusive inclusive rows x rows loops node
1. 0.165 278,579.851 ↑ 3.5 151 1

HashAggregate (cost=681,112.69..681,117.93 rows=524 width=924) (actual time=278,579.817..278,579.851 rows=151 loops=1)

  • Group Key: ('04'::text), ('PAGAR'::text), oi.documentno, (currencyconvert(oi.openamt, oi.c_currency_id, '297'::numeric, '2018-12-26 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.016 278,579.686 ↑ 3.5 151 1

Append (cost=93,681.36..681,098.28 rows=524 width=924) (actual time=17,388.806..278,579.686 rows=151 loops=1)

3. 0.014 17,388.927 ↑ 9.0 7 1

Hash Left Join (cost=93,681.36..94,033.67 rows=63 width=814) (actual time=17,388.806..17,388.927 rows=7 loops=1)

  • Hash Cond: (oi.cof_c_planofinanceiro_id = pf.cof_c_planofinanceiro_id)
4. 0.007 17,388.857 ↑ 9.0 7 1

Hash Left Join (cost=93,673.78..94,010.17 rows=63 width=773) (actual time=17,388.743..17,388.857 rows=7 loops=1)

  • Hash Cond: (oi.c_activity_id = ac.c_activity_id)
5. 0.004 17,388.844 ↑ 9.0 7 1

Nested Loop Left Join (cost=93,672.58..94,008.81 rows=63 width=776) (actual time=17,388.733..17,388.844 rows=7 loops=1)

6. 0.008 17,388.819 ↑ 9.0 7 1

Nested Loop Left Join (cost=93,672.29..93,877.39 rows=63 width=764) (actual time=17,388.725..17,388.819 rows=7 loops=1)

  • Filter: ((t.cof_billfoldtype IS NULL) OR ((t.cof_billfoldtype)::text = 'CS'::text))
7. 0.140 17,388.811 ↑ 9.0 7 1

Hash Right Join (cost=93,672.00..93,728.53 rows=63 width=780) (actual time=17,388.720..17,388.811 rows=7 loops=1)

  • Hash Cond: (u1.c_elementvalue_id = oi.user1_id)
8. 0.118 0.118 ↑ 1.0 1,145 1

Seq Scan on c_elementvalue u1 (cost=0.00..44.45 rows=1,145 width=32) (actual time=0.008..0.118 rows=1,145 loops=1)

9. 0.004 17,388.553 ↑ 9.0 7 1

Hash (cost=93,671.21..93,671.21 rows=63 width=770) (actual time=17,388.553..17,388.553 rows=7 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.250 17,388.549 ↑ 9.0 7 1

Subquery Scan on oi (cost=93,386.36..93,671.21 rows=63 width=770) (actual time=17,385.422..17,388.549 rows=7 loops=1)

  • Filter: (oi.duedate = '2019-04-07'::date)
  • Rows Removed by Filter: 3049
11. 19.816 17,388.299 ↑ 4.1 3,056 1

HashAggregate (cost=93,386.36..93,512.96 rows=12,660 width=3,648) (actual time=17,385.124..17,388.299 rows=3,056 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
12. 0.406 17,368.483 ↑ 4.1 3,056 1

Append (cost=14,448.45..89,841.56 rows=12,660 width=3,648) (actual time=189.803..17,368.483 rows=3,056 loops=1)

13. 0.198 362.376 ↑ 7.0 307 1

Subquery Scan on *SELECT* 1 (cost=14,448.45..28,752.63 rows=2,159 width=1,274) (actual time=189.803..362.376 rows=307 loops=1)

14. 173.510 362.178 ↑ 7.0 307 1

Hash Left Join (cost=14,448.45..28,725.64 rows=2,159 width=1,270) (actual time=189.801..362.178 rows=307 loops=1)

  • Hash Cond: (bp_1.c_bp_group_id = bpg.c_bp_group_id)
15. 0.285 188.660 ↑ 7.0 307 1

Hash Left Join (cost=14,447.31..19,938.50 rows=2,159 width=822) (actual time=186.810..188.660 rows=307 loops=1)

  • Hash Cond: (i.c_bpartner_id = bp_1.c_bpartner_id)
16. 0.142 180.006 ↑ 7.0 307 1

Hash Left Join (cost=13,020.99..18,506.51 rows=2,159 width=803) (actual time=178.363..180.006 rows=307 loops=1)

  • Hash Cond: (t_1.cof_c_bankoccurrence_id = bo.cof_c_bankoccurrence_id)
17. 0.153 179.829 ↑ 7.0 307 1

Hash Left Join (cost=13,017.33..18,496.91 rows=2,159 width=767) (actual time=178.322..179.829 rows=307 loops=1)

  • Hash Cond: (t_1.cof_c_bankintegration_id = bi.cof_c_bankintegration_id)
18. 0.169 179.661 ↑ 7.0 307 1

Nested Loop Left Join (cost=13,015.94..18,488.45 rows=2,159 width=744) (actual time=178.299..179.661 rows=307 loops=1)

19. 0.278 178.878 ↑ 7.0 307 1

Hash Join (cost=13,015.66..15,728.26 rows=2,159 width=728) (actual time=178.293..178.878 rows=307 loops=1)

  • Hash Cond: (i.c_paymentterm_id = p.c_paymentterm_id)
20. 0.350 178.572 ↑ 7.0 307 1

Hash Right Join (cost=13,012.42..15,718.92 rows=2,159 width=719) (actual time=178.256..178.572 rows=307 loops=1)

  • Hash Cond: (t_1.c_invoice_id = i.c_invoice_id)
21. 11.237 11.237 ↑ 97.5 97 1

Index Scan using idx_cof_titulo_coalesce_c_invoicepayschedule_id on cof_titulo t_1 (cost=0.29..2,669.52 rows=9,459 width=201) (actual time=0.030..11.237 rows=97 loops=1)

  • Index Cond: (COALESCE(c_invoicepayschedule_id, '0'::numeric) = '0'::numeric)
  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 12072
22. 0.194 166.985 ↑ 7.0 307 1

Hash (cost=12,985.14..12,985.14 rows=2,159 width=524) (actual time=166.985..166.985 rows=307 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 141kB
23. 2.529 166.791 ↑ 7.0 307 1

Merge Left Join (cost=12,346.97..12,985.14 rows=2,159 width=524) (actual time=165.838..166.791 rows=307 loops=1)

  • Merge Cond: (i.c_invoice_id = df_1.c_invoice_id)
24. 0.206 161.146 ↑ 7.0 307 1

Sort (cost=12,346.69..12,352.08 rows=2,159 width=524) (actual time=161.132..161.146 rows=307 loops=1)

  • Sort Key: i.c_invoice_id
  • Sort Method: quicksort Memory: 183kB
25. 1.722 160.940 ↑ 7.0 307 1

Merge Join (cost=11,803.22..12,227.12 rows=2,159 width=524) (actual time=157.724..160.940 rows=307 loops=1)

  • Merge Cond: (i.c_bpartner_id = b.c_bpartner_id)
26. 0.262 157.257 ↑ 7.0 307 1

Sort (cost=11,802.93..11,808.33 rows=2,159 width=524) (actual time=157.245..157.257 rows=307 loops=1)

  • Sort Key: i.c_bpartner_id
  • Sort Method: quicksort Memory: 183kB
27. 0.121 156.995 ↑ 7.0 307 1

Hash Join (cost=11,207.66..11,683.37 rows=2,159 width=524) (actual time=153.714..156.995 rows=307 loops=1)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
28. 1.856 156.779 ↑ 7.0 307 1

Hash Join (cost=11,194.16..11,664.08 rows=2,159 width=520) (actual time=153.612..156.779 rows=307 loops=1)

  • Hash Cond: (loc.c_location_id = bpl.c_location_id)
29. 1.615 1.615 ↓ 1.0 20,521 1

Index Only Scan using c_location_pkey on c_location loc (cost=0.29..371.71 rows=20,508 width=6) (actual time=0.027..1.615 rows=20,521 loops=1)

  • Heap Fetches: 293
30. 0.342 153.308 ↑ 7.0 307 1

Hash (cost=11,166.89..11,166.89 rows=2,159 width=526) (actual time=153.308..153.308 rows=307 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 142kB
31. 0.317 152.966 ↑ 7.0 307 1

Hash Join (cost=1,963.53..11,166.89 rows=2,159 width=526) (actual time=48.124..152.966 rows=307 loops=1)

  • Hash Cond: (i.c_bpartner_location_id = bpl.c_bpartner_location_id)
32. 144.995 144.995 ↑ 7.0 307 1

Index Scan using idx_c_invoice_docstatus_ispayschedulevalid_issotrx on c_invoice i (cost=0.42..9,198.11 rows=2,159 width=520) (actual time=40.460..144.995 rows=307 loops=1)

  • Index Cond: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (issotrx = 'N'::bpchar))
  • Filter: ((ispayschedulevalid <> 'Y'::bpchar) AND (cof_composescashflow = 'Y'::bpchar) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::numeric[])) AND (invoiceopen(c_invoice_id, '0'::numeric) <> '0'::numeric))
  • Rows Removed by Filter: 12797
33. 2.487 7.654 ↓ 1.0 20,239 1

Hash (cost=1,710.27..1,710.27 rows=20,227 width=12) (actual time=7.654..7.654 rows=20,239 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1166kB
34. 5.167 5.167 ↓ 1.0 20,239 1

Seq Scan on c_bpartner_location bpl (cost=0.00..1,710.27 rows=20,227 width=12) (actual time=0.009..5.167 rows=20,239 loops=1)

35. 0.029 0.095 ↑ 1.0 200 1

Hash (cost=11.00..11.00 rows=200 width=10) (actual time=0.095..0.095 rows=200 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
36. 0.066 0.066 ↑ 1.0 200 1

Seq Scan on c_doctype d (cost=0.00..11.00 rows=200 width=10) (actual time=0.003..0.066 rows=200 loops=1)

37. 1.961 1.961 ↑ 1.0 18,641 1

Index Only Scan using c_bpartner_pkey on c_bpartner b (cost=0.29..344.57 rows=18,992 width=6) (actual time=0.025..1.961 rows=18,641 loops=1)

  • Heap Fetches: 1775
38. 3.116 3.116 ↑ 1.0 28,871 1

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_1 (cost=0.29..549.10 rows=30,061 width=6) (actual time=0.022..3.116 rows=28,871 loops=1)

  • Heap Fetches: 1794
39. 0.012 0.028 ↑ 1.0 55 1

Hash (cost=2.55..2.55 rows=55 width=15) (actual time=0.028..0.028 rows=55 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
40. 0.016 0.016 ↑ 1.0 55 1

Seq Scan on c_paymentterm p (cost=0.00..2.55 rows=55 width=15) (actual time=0.005..0.016 rows=55 loops=1)

41. 0.614 0.614 ↓ 0.0 0 307

Index Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df (cost=0.29..1.27 rows=1 width=22) (actual time=0.002..0.002 rows=0 loops=307)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
42. 0.006 0.015 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=29) (actual time=0.015..0.015 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
43. 0.009 0.009 ↑ 1.0 17 1

Seq Scan on cof_c_bankintegration bi (cost=0.00..1.17 rows=17 width=29) (actual time=0.007..0.009 rows=17 loops=1)

44. 0.018 0.035 ↑ 1.0 74 1

Hash (cost=2.74..2.74 rows=74 width=43) (actual time=0.035..0.035 rows=74 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
45. 0.017 0.017 ↑ 1.0 74 1

Seq Scan on cof_c_bankoccurrence bo (cost=0.00..2.74 rows=74 width=43) (actual time=0.007..0.017 rows=74 loops=1)

46. 3.054 8.369 ↓ 1.0 19,000 1

Hash (cost=1,188.92..1,188.92 rows=18,992 width=25) (actual time=8.369..8.369 rows=19,000 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1350kB
47. 5.315 5.315 ↓ 1.0 19,000 1

Seq Scan on c_bpartner bp_1 (cost=0.00..1,188.92 rows=18,992 width=25) (actual time=0.004..5.315 rows=19,000 loops=1)

48. 0.004 0.008 ↑ 1.0 6 1

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

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

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

50. 2.589 17,005.701 ↑ 3.8 2,749 1

Subquery Scan on *SELECT* 2 (cost=15,398.50..61,088.94 rows=10,501 width=1,201) (actual time=121.223..17,005.701 rows=2,749 loops=1)

51. 3,555.270 17,003.112 ↑ 3.8 2,749 1

Hash Left Join (cost=15,398.50..60,931.42 rows=10,501 width=1,173) (actual time=121.221..17,003.112 rows=2,749 loops=1)

  • Hash Cond: (bp_2.c_bp_group_id = bpg_1.c_bp_group_id)
52. 1.438 13,447.838 ↑ 3.8 2,749 1

Hash Left Join (cost=15,397.37..28,802.70 rows=10,501 width=855) (actual time=120.388..13,447.838 rows=2,749 loops=1)

  • Hash Cond: (t_2.cof_c_bankoccurrence_id = bo_1.cof_c_bankoccurrence_id)
53. 1.704 13,446.375 ↑ 3.8 2,749 1

Hash Left Join (cost=15,393.70..28,770.17 rows=10,501 width=819) (actual time=120.360..13,446.375 rows=2,749 loops=1)

  • Hash Cond: (t_2.cof_c_bankintegration_id = bi_1.cof_c_bankintegration_id)
54. 2.727 13,444.661 ↑ 3.8 2,749 1

Nested Loop Left Join (cost=15,392.32..28,734.34 rows=10,501 width=796) (actual time=120.345..13,444.661 rows=2,749 loops=1)

  • Join Filter: (t_2.c_invoice_id = i_1.c_invoice_id)
55. 13,277.178 13,436.436 ↑ 3.8 2,749 1

Hash Join (cost=15,392.03..24,825.74 rows=10,501 width=601) (actual time=120.331..13,436.436 rows=2,749 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: 12362
56. 39.968 39.968 ↓ 1.0 163,333 1

Seq Scan on c_invoicepayschedule ips (cost=0.00..6,050.91 rows=163,299 width=54) (actual time=0.004..39.968 rows=163,333 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 61
57. 6.462 119.290 ↓ 1.3 9,345 1

Hash (cost=15,300.57..15,300.57 rows=7,317 width=553) (actual time=119.290..119.290 rows=9,345 loops=1)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 3793kB
58. 4.128 112.828 ↓ 1.3 9,345 1

Hash Left Join (cost=9,414.65..15,300.57 rows=7,317 width=553) (actual time=73.203..112.828 rows=9,345 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = bp_2.c_bpartner_id)
59. 26.260 101.952 ↓ 1.3 9,345 1

Hash Right Join (cost=7,988.33..13,855.04 rows=7,317 width=534) (actual time=66.375..101.952 rows=9,345 loops=1)

  • Hash Cond: (df_2.c_invoice_id = i_1.c_invoice_id)
60. 9.405 9.405 ↓ 1.0 30,081 1

Seq Scan on lbr_docfiscal df_2 (cost=0.00..5,734.61 rows=30,061 width=22) (actual time=0.005..9.405 rows=30,081 loops=1)

61. 6.583 66.287 ↓ 1.3 9,345 1

Hash (cost=7,896.87..7,896.87 rows=7,317 width=518) (actual time=66.287..66.287 rows=9,345 loops=1)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 3582kB
62. 3.892 59.704 ↓ 1.3 9,345 1

Hash Join (cost=7,191.91..7,896.87 rows=7,317 width=518) (actual time=33.497..59.704 rows=9,345 loops=1)

  • Hash Cond: (bpl_1.c_location_id = loc_1.c_location_id)
63. 3.800 51.821 ↓ 1.3 9,345 1

Hash Join (cost=6,563.85..7,249.61 rows=7,317 width=524) (actual time=29.490..51.821 rows=9,345 loops=1)

  • Hash Cond: (i_1.c_bpartner_location_id = bpl_1.c_bpartner_location_id)
64. 3.815 41.315 ↓ 1.3 9,345 1

Hash Join (cost=4,600.74..5,267.29 rows=7,317 width=518) (actual time=22.712..41.315 rows=9,345 loops=1)

  • Hash Cond: (i_1.c_bpartner_id = b_1.c_bpartner_id)
65. 3.930 33.451 ↓ 1.3 9,345 1

Hash Join (cost=4,018.77..4,666.12 rows=7,317 width=518) (actual time=18.591..33.451 rows=9,345 loops=1)

  • Hash Cond: (i_1.c_doctype_id = d_1.c_doctype_id)
66. 8.318 29.458 ↓ 1.3 9,345 1

Hash Right Join (cost=4,005.27..4,633.00 rows=7,317 width=514) (actual time=18.520..29.458 rows=9,345 loops=1)

  • Hash Cond: (df_3.c_invoice_id = i_1.c_invoice_id)
67. 2.695 2.695 ↓ 1.0 30,081 1

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_3 (cost=0.29..549.10 rows=30,061 width=6) (actual time=0.012..2.695 rows=30,081 loops=1)

  • Heap Fetches: 1816
68. 5.863 18.445 ↓ 1.3 9,345 1

Hash (cost=3,913.52..3,913.52 rows=7,317 width=514) (actual time=18.445..18.445 rows=9,345 loops=1)

  • Buckets: 16384 (originally 8192) Batches: 1 (originally 1) Memory Usage: 3545kB
69. 12.582 12.582 ↓ 1.3 9,345 1

Index Scan using idx_c_invoice_docstatus_ispayschedulevalid_issotrx on c_invoice i_1 (cost=0.42..3,913.52 rows=7,317 width=514) (actual time=0.017..12.582 rows=9,345 loops=1)

  • Index Cond: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ispayschedulevalid = 'Y'::bpchar) AND (issotrx = 'N'::bpchar))
  • Filter: ((cof_composescashflow = 'Y'::bpchar) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::numeric[])))
  • Rows Removed by Filter: 2919
70. 0.027 0.063 ↑ 1.0 200 1

Hash (cost=11.00..11.00 rows=200 width=10) (actual time=0.063..0.063 rows=200 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
71. 0.036 0.036 ↑ 1.0 200 1

Seq Scan on c_doctype d_1 (cost=0.00..11.00 rows=200 width=10) (actual time=0.003..0.036 rows=200 loops=1)

72. 2.272 4.049 ↓ 1.0 19,000 1

Hash (cost=344.57..344.57 rows=18,992 width=6) (actual time=4.048..4.049 rows=19,000 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 980kB
73. 1.777 1.777 ↓ 1.0 19,000 1

Index Only Scan using c_bpartner_pkey on c_bpartner b_1 (cost=0.29..344.57 rows=18,992 width=6) (actual time=0.016..1.777 rows=19,000 loops=1)

  • Heap Fetches: 1816
74. 2.644 6.706 ↓ 1.0 20,239 1

Hash (cost=1,710.27..1,710.27 rows=20,227 width=12) (actual time=6.706..6.706 rows=20,239 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1166kB
75. 4.062 4.062 ↓ 1.0 20,239 1

Seq Scan on c_bpartner_location bpl_1 (cost=0.00..1,710.27 rows=20,227 width=12) (actual time=0.003..4.062 rows=20,239 loops=1)

76. 2.416 3.991 ↓ 1.0 20,521 1

Hash (cost=371.71..371.71 rows=20,508 width=6) (actual time=3.991..3.991 rows=20,521 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1038kB
77. 1.575 1.575 ↓ 1.0 20,521 1

Index Only Scan using c_location_pkey on c_location loc_1 (cost=0.29..371.71 rows=20,508 width=6) (actual time=0.011..1.575 rows=20,521 loops=1)

  • Heap Fetches: 293
78. 2.988 6.748 ↓ 1.0 19,000 1

Hash (cost=1,188.92..1,188.92 rows=18,992 width=25) (actual time=6.748..6.748 rows=19,000 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1350kB
79. 3.760 3.760 ↓ 1.0 19,000 1

Seq Scan on c_bpartner bp_2 (cost=0.00..1,188.92 rows=18,992 width=25) (actual time=0.004..3.760 rows=19,000 loops=1)

80. 5.498 5.498 ↓ 0.0 0 2,749

Index Scan using idx_cof_titulo_c_invoicepayschedule_id_isvalid_cof_billfoldtype on cof_titulo t_2 (cost=0.29..0.36 rows=1 width=207) (actual time=0.002..0.002 rows=0 loops=2,749)

  • Index Cond: ((c_invoicepayschedule_id = ips.c_invoicepayschedule_id) AND (isvalid = 'Y'::bpchar))
81. 0.004 0.010 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=29) (actual time=0.010..0.010 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
82. 0.006 0.006 ↑ 1.0 17 1

Seq Scan on cof_c_bankintegration bi_1 (cost=0.00..1.17 rows=17 width=29) (actual time=0.004..0.006 rows=17 loops=1)

83. 0.012 0.025 ↑ 1.0 74 1

Hash (cost=2.74..2.74 rows=74 width=43) (actual time=0.025..0.025 rows=74 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
84. 0.013 0.013 ↑ 1.0 74 1

Seq Scan on cof_c_bankoccurrence bo_1 (cost=0.00..2.74 rows=74 width=43) (actual time=0.003..0.013 rows=74 loops=1)

85. 0.001 0.004 ↑ 1.0 6 1

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

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

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

87.          

SubPlan (forHash Left Join)

88. 0.000 0.000 ↑ 1.0 1 2,749

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

89. 0.000 0.000 ↓ 0.0 0 7

Index Scan using cof_titulo_key on cof_titulo t (cost=0.29..2.35 rows=1 width=9) (actual time=0.000..0.000 rows=0 loops=7)

  • Index Cond: (cof_titulo_id = oi.cof_titulo_id)
90. 0.021 0.021 ↑ 1.0 1 7

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

  • Index Cond: (c_bpartner_id = oi.c_bpartner_id)
91. 0.002 0.006 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=19) (actual time=0.006..0.006 rows=9 loops=1)

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

Seq Scan on c_activity ac (cost=0.00..1.09 rows=9 width=19) (actual time=0.003..0.004 rows=9 loops=1)

93. 0.021 0.056 ↑ 1.0 159 1

Hash (cost=5.59..5.59 rows=159 width=32) (actual time=0.056..0.056 rows=159 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
94. 0.035 0.035 ↑ 1.0 159 1

Seq Scan on cof_c_planofinanceiro pf (cost=0.00..5.59 rows=159 width=32) (actual time=0.005..0.035 rows=159 loops=1)

95. 0.255 261,130.876 ↑ 3.2 143 1

Hash Left Join (cost=500,044.66..527,791.84 rows=456 width=814) (actual time=261,077.101..261,130.876 rows=143 loops=1)

  • Hash Cond: ("*SELECT* 1_1".cof_c_planofinanceiro_id = pf_1.cof_c_planofinanceiro_id)
96. 0.053 261,130.572 ↑ 3.2 143 1

Hash Left Join (cost=500,037.08..527,669.04 rows=456 width=773) (actual time=261,077.031..261,130.572 rows=143 loops=1)

  • Hash Cond: ("*SELECT* 1_1".c_activity_id = ac_1.c_activity_id)
97. 0.061 261,130.512 ↑ 3.2 143 1

Hash Left Join (cost=500,035.88..527,666.62 rows=456 width=776) (actual time=261,077.018..261,130.512 rows=143 loops=1)

  • Hash Cond: ("*SELECT* 1_1".user1_id = u1_1.c_elementvalue_id)
98. 0.147 261,130.124 ↑ 3.2 143 1

Nested Loop Left Join (cost=499,977.12..527,606.66 rows=456 width=766) (actual time=261,076.680..261,130.124 rows=143 loops=1)

99. 16.830 261,129.691 ↑ 3.2 143 1

Hash Left Join (cost=499,976.83..527,461.79 rows=456 width=754) (actual time=261,076.664..261,129.691 rows=143 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-04-07'::date)
  • Rows Removed by Filter: 35251
100. 5.635 261,112.839 ↑ 2.6 35,394 1

Hash Left Join (cost=499,975.27..527,206.49 rows=91,256 width=782) (actual time=261,065.794..261,112.839 rows=35,394 loops=1)

  • Hash Cond: (t_3.cof_c_bankintegration_id = bai.cof_c_bankintegration_id)
101. 17.932 261,107.189 ↑ 2.6 35,394 1

Hash Left Join (cost=499,973.89..526,905.84 rows=91,256 width=785) (actual time=261,065.771..261,107.189 rows=35,394 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))
102. 21.489 261,048.592 ↑ 2.6 35,394 1

Unique (cost=491,657.77..517,437.59 rows=91,256 width=3,648) (actual time=261,025.079..261,048.592 rows=35,394 loops=1)

103. 240.896 261,027.103 ↑ 2.6 35,394 1

Sort (cost=491,657.77..491,885.91 rows=91,256 width=3,648) (actual time=261,025.078..261,027.103 rows=35,394 loops=1)

  • Sort 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
  • Sort Method: quicksort Memory: 24806kB
104. 5.168 260,786.207 ↑ 2.6 35,394 1

Append (cost=38,855.24..400,284.11 rows=91,256 width=3,648) (actual time=7,291.450..260,786.207 rows=35,394 loops=1)

105. 0.301 7,579.268 ↑ 33.8 460 1

Subquery Scan on *SELECT* 1_1 (cost=38,855.24..108,364.66 rows=15,565 width=1,274) (actual time=7,291.449..7,579.268 rows=460 loops=1)

106. 263.251 7,578.967 ↑ 33.8 460 1

Hash Left Join (cost=38,855.24..108,170.09 rows=15,565 width=1,270) (actual time=7,291.448..7,578.967 rows=460 loops=1)

  • Hash Cond: (bp_4.c_bp_group_id = bpg_2.c_bp_group_id)
107. 0.409 7,315.710 ↑ 33.8 460 1

Hash Left Join (cost=38,854.10..44,827.52 rows=15,565 width=822) (actual time=7,290.663..7,315.710 rows=460 loops=1)

  • Hash Cond: (i_2.c_bpartner_id = bp_4.c_bpartner_id)
108. 0.398 7,308.537 ↑ 33.8 460 1

Hash Join (cost=37,427.78..43,360.33 rows=15,565 width=803) (actual time=7,283.842..7,308.537 rows=460 loops=1)

  • Hash Cond: (i_2.c_paymentterm_id = p_1.c_paymentterm_id)
109. 20.469 7,308.118 ↑ 33.8 460 1

Hash Right Join (cost=37,424.54..43,313.08 rows=15,565 width=794) (actual time=7,283.815..7,308.118 rows=460 loops=1)

  • Hash Cond: (df_4.c_invoice_id = i_2.c_invoice_id)
110. 4.499 4.499 ↓ 1.0 30,081 1

Seq Scan on lbr_docfiscal df_4 (cost=0.00..5,734.61 rows=30,061 width=22) (actual time=0.004..4.499 rows=30,081 loops=1)

111. 0.265 7,283.150 ↑ 33.8 460 1

Hash (cost=37,229.98..37,229.98 rows=15,565 width=778) (actual time=7,283.150..7,283.150 rows=460 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 300kB
112. 0.327 7,282.885 ↑ 33.8 460 1

Hash Right Join (cost=34,455.26..37,229.98 rows=15,565 width=778) (actual time=7,274.705..7,282.885 rows=460 loops=1)

  • Hash Cond: (t_4.c_invoice_id = i_2.c_invoice_id)
113. 0.024 8.530 ↑ 97.5 97 1

Hash Left Join (cost=5.34..2,731.58 rows=9,459 width=260) (actual time=0.058..8.530 rows=97 loops=1)

  • Hash Cond: (t_4.cof_c_bankoccurrence_id = bo_2.cof_c_bankoccurrence_id)
114. 0.032 8.483 ↑ 97.5 97 1

Hash Left Join (cost=1.67..2,701.92 rows=9,459 width=224) (actual time=0.032..8.483 rows=97 loops=1)

  • Hash Cond: (t_4.cof_c_bankintegration_id = bi_2.cof_c_bankintegration_id)
115. 8.441 8.441 ↑ 97.5 97 1

Index Scan using idx_cof_titulo_coalesce_c_invoicepayschedule_id on cof_titulo t_4 (cost=0.29..2,669.52 rows=9,459 width=201) (actual time=0.019..8.441 rows=97 loops=1)

  • Index Cond: (COALESCE(c_invoicepayschedule_id, '0'::numeric) = '0'::numeric)
  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 12072
116. 0.003 0.010 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=29) (actual time=0.010..0.010 rows=17 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
117. 0.007 0.007 ↑ 1.0 17 1

Seq Scan on cof_c_bankintegration bi_2 (cost=0.00..1.17 rows=17 width=29) (actual time=0.004..0.007 rows=17 loops=1)

118. 0.011 0.023 ↑ 1.0 74 1

Hash (cost=2.74..2.74 rows=74 width=43) (actual time=0.023..0.023 rows=74 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
119. 0.012 0.012 ↑ 1.0 74 1

Seq Scan on cof_c_bankoccurrence bo_2 (cost=0.00..2.74 rows=74 width=43) (actual time=0.003..0.012 rows=74 loops=1)

120. 0.807 7,274.028 ↑ 33.8 460 1

Hash (cost=34,255.36..34,255.36 rows=15,565 width=524) (actual time=7,274.028..7,274.028 rows=460 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 299kB
121. 0.481 7,273.221 ↑ 33.8 460 1

Hash Left Join (cost=4,111.91..34,255.36 rows=15,565 width=524) (actual time=21.951..7,273.221 rows=460 loops=1)

  • Hash Cond: (i_2.c_invoice_id = df_5.c_invoice_id)
122. 0.412 7,266.327 ↑ 33.8 460 1

Hash Join (cost=3,187.05..33,211.47 rows=15,565 width=524) (actual time=15.463..7,266.327 rows=460 loops=1)

  • Hash Cond: (bpl_2.c_location_id = loc_2.c_location_id)
123. 0.435 7,261.834 ↑ 33.8 460 1

Hash Join (cost=2,558.99..32,542.55 rows=15,565 width=530) (actual time=11.310..7,261.834 rows=460 loops=1)

  • Hash Cond: (i_2.c_bpartner_location_id = bpl_2.c_bpartner_location_id)
124. 0.386 7,254.675 ↑ 33.8 460 1

Hash Join (cost=595.89..30,538.57 rows=15,565 width=524) (actual time=4.514..7,254.675 rows=460 loops=1)

  • Hash Cond: (i_2.c_bpartner_id = b_2.c_bpartner_id)
125. 0.553 7,250.264 ↑ 33.8 460 1

Hash Join (cost=13.92..29,915.73 rows=15,565 width=524) (actual time=0.472..7,250.264 rows=460 loops=1)

  • Hash Cond: (i_2.c_doctype_id = d_2.c_doctype_id)
126. 7,249.651 7,249.651 ↑ 33.8 460 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i_2 (cost=0.42..29,860.51 rows=15,565 width=520) (actual time=0.406..7,249.651 rows=460 loops=1)

  • Index Cond: ((ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::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: 80970
127. 0.024 0.060 ↑ 1.0 200 1

Hash (cost=11.00..11.00 rows=200 width=10) (actual time=0.060..0.060 rows=200 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
128. 0.036 0.036 ↑ 1.0 200 1

Seq Scan on c_doctype d_2 (cost=0.00..11.00 rows=200 width=10) (actual time=0.002..0.036 rows=200 loops=1)

129. 2.247 4.025 ↓ 1.0 19,000 1

Hash (cost=344.57..344.57 rows=18,992 width=6) (actual time=4.025..4.025 rows=19,000 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 980kB
130. 1.778 1.778 ↓ 1.0 19,000 1

Index Only Scan using c_bpartner_pkey on c_bpartner b_2 (cost=0.29..344.57 rows=18,992 width=6) (actual time=0.014..1.778 rows=19,000 loops=1)

  • Heap Fetches: 1815
131. 2.651 6.724 ↓ 1.0 20,239 1

Hash (cost=1,710.27..1,710.27 rows=20,227 width=12) (actual time=6.724..6.724 rows=20,239 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1166kB
132. 4.073 4.073 ↓ 1.0 20,239 1

Seq Scan on c_bpartner_location bpl_2 (cost=0.00..1,710.27 rows=20,227 width=12) (actual time=0.003..4.073 rows=20,239 loops=1)

133. 2.490 4.081 ↓ 1.0 20,521 1

Hash (cost=371.71..371.71 rows=20,508 width=6) (actual time=4.081..4.081 rows=20,521 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1038kB
134. 1.591 1.591 ↓ 1.0 20,521 1

Index Only Scan using c_location_pkey on c_location loc_2 (cost=0.29..371.71 rows=20,508 width=6) (actual time=0.013..1.591 rows=20,521 loops=1)

  • Heap Fetches: 293
135. 3.643 6.413 ↑ 1.0 29,985 1

Hash (cost=549.10..549.10 rows=30,061 width=6) (actual time=6.413..6.413 rows=29,985 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1398kB
136. 2.770 2.770 ↓ 1.0 30,081 1

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_5 (cost=0.29..549.10 rows=30,061 width=6) (actual time=0.014..2.770 rows=30,081 loops=1)

  • Heap Fetches: 1816
137. 0.008 0.021 ↑ 1.0 55 1

Hash (cost=2.55..2.55 rows=55 width=15) (actual time=0.021..0.021 rows=55 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
138. 0.013 0.013 ↑ 1.0 55 1

Seq Scan on c_paymentterm p_1 (cost=0.00..2.55 rows=55 width=15) (actual time=0.003..0.013 rows=55 loops=1)

139. 3.015 6.764 ↓ 1.0 19,000 1

Hash (cost=1,188.92..1,188.92 rows=18,992 width=25) (actual time=6.764..6.764 rows=19,000 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1350kB
140. 3.749 3.749 ↓ 1.0 19,000 1

Seq Scan on c_bpartner bp_4 (cost=0.00..1,188.92 rows=18,992 width=25) (actual time=0.004..3.749 rows=19,000 loops=1)

141. 0.003 0.006 ↑ 1.0 6 1

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

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

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

143. 31.047 253,201.771 ↑ 2.2 34,934 1

Subquery Scan on *SELECT* 2_1 (cost=31,430.65..291,919.46 rows=75,691 width=1,201) (actual time=384.639..253,201.771 rows=34,934 loops=1)

144. 59,929.323 253,170.724 ↑ 2.2 34,934 1

Hash Left Join (cost=31,430.65..290,784.09 rows=75,691 width=1,173) (actual time=384.637..253,170.724 rows=34,934 loops=1)

  • Hash Cond: (bp_5.c_bp_group_id = bpg_3.c_bp_group_id)
145. 24.446 193,241.394 ↑ 2.2 34,934 1

Hash Left Join (cost=31,429.51..59,207.92 rows=75,691 width=855) (actual time=383.852..193,241.394 rows=34,934 loops=1)

  • Hash Cond: (i_3.c_invoice_id = df_6.c_invoice_id)
146. 38.587 193,187.074 ↑ 2.2 34,934 1

Hash Left Join (cost=25,319.14..52,518.75 rows=75,691 width=839) (actual time=353.896..193,187.074 rows=34,934 loops=1)

  • Hash Cond: ((i_3.c_invoice_id = t_5.c_invoice_id) AND (ips_1.c_invoicepayschedule_id = t_5.c_invoicepayschedule_id))
147. 192,738.429 193,072.475 ↑ 2.2 34,934 1

Hash Join (cost=16,645.54..43,277.46 rows=75,691 width=585) (actual time=277.835..193,072.475 rows=34,934 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: 75806
148. 58.324 58.324 ↓ 1.0 163,333 1

Seq Scan on c_invoicepayschedule ips_1 (cost=0.00..6,050.91 rows=163,299 width=54) (actual time=0.006..58.324 rows=163,333 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 61
149. 41.269 275.722 ↓ 1.1 56,709 1

Hash (cost=15,986.31..15,986.31 rows=52,739 width=537) (actual time=275.722..275.722 rows=56,709 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 21701kB
150. 27.397 234.453 ↓ 1.1 56,709 1

Hash Left Join (cost=5,538.23..15,986.31 rows=52,739 width=537) (actual time=28.158..234.453 rows=56,709 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = bp_5.c_bpartner_id)
151. 23.271 200.454 ↓ 1.1 56,709 1

Hash Left Join (cost=4,111.91..14,421.51 rows=52,739 width=518) (actual time=21.480..200.454 rows=56,709 loops=1)

  • Hash Cond: (i_3.c_invoice_id = df_7.c_invoice_id)
152. 24.458 170.912 ↓ 1.1 56,709 1

Hash Join (cost=3,187.05..13,093.36 rows=52,739 width=518) (actual time=15.135..170.912 rows=56,709 loops=1)

  • Hash Cond: (bpl_3.c_location_id = loc_3.c_location_id)
153. 25.799 142.428 ↓ 1.1 56,709 1

Hash Join (cost=2,558.99..12,326.83 rows=52,739 width=524) (actual time=11.037..142.428 rows=56,709 loops=1)

  • Hash Cond: (i_3.c_bpartner_location_id = bpl_3.c_bpartner_location_id)
154. 23.875 109.875 ↓ 1.1 56,709 1

Hash Join (cost=595.89..10,225.25 rows=52,739 width=518) (actual time=4.210..109.875 rows=56,709 loops=1)

  • Hash Cond: (i_3.c_bpartner_id = b_3.c_bpartner_id)
155. 25.308 81.956 ↓ 1.1 56,709 1

Hash Join (cost=13.92..9,504.81 rows=52,739 width=518) (actual time=0.092..81.956 rows=56,709 loops=1)

  • Hash Cond: (i_3.c_doctype_id = d_3.c_doctype_id)
156. 56.582 56.582 ↓ 1.1 56,709 1

Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i_3 (cost=0.42..9,349.93 rows=52,739 width=514) (actual time=0.019..56.582 rows=56,709 loops=1)

  • Index Cond: ((ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::numeric[])))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (ispayschedulevalid = 'Y'::bpchar) AND (issotrx = 'Y'::bpchar) AND (cof_composescashflow = 'Y'::bpchar))
  • Rows Removed by Filter: 24721
157. 0.031 0.066 ↑ 1.0 200 1

Hash (cost=11.00..11.00 rows=200 width=10) (actual time=0.066..0.066 rows=200 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
158. 0.035 0.035 ↑ 1.0 200 1

Seq Scan on c_doctype d_3 (cost=0.00..11.00 rows=200 width=10) (actual time=0.002..0.035 rows=200 loops=1)

159. 2.275 4.044 ↓ 1.0 19,000 1

Hash (cost=344.57..344.57 rows=18,992 width=6) (actual time=4.044..4.044 rows=19,000 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 980kB
160. 1.769 1.769 ↓ 1.0 19,000 1

Index Only Scan using c_bpartner_pkey on c_bpartner b_3 (cost=0.29..344.57 rows=18,992 width=6) (actual time=0.016..1.769 rows=19,000 loops=1)

  • Heap Fetches: 1815
161. 2.668 6.754 ↓ 1.0 20,239 1

Hash (cost=1,710.27..1,710.27 rows=20,227 width=12) (actual time=6.754..6.754 rows=20,239 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1166kB
162. 4.086 4.086 ↓ 1.0 20,239 1

Seq Scan on c_bpartner_location bpl_3 (cost=0.00..1,710.27 rows=20,227 width=12) (actual time=0.003..4.086 rows=20,239 loops=1)

163. 2.440 4.026 ↓ 1.0 20,521 1

Hash (cost=371.71..371.71 rows=20,508 width=6) (actual time=4.026..4.026 rows=20,521 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1038kB
164. 1.586 1.586 ↓ 1.0 20,521 1

Index Only Scan using c_location_pkey on c_location loc_3 (cost=0.29..371.71 rows=20,508 width=6) (actual time=0.010..1.586 rows=20,521 loops=1)

  • Heap Fetches: 293
165. 3.579 6.271 ↑ 1.0 29,985 1

Hash (cost=549.10..549.10 rows=30,061 width=6) (actual time=6.271..6.271 rows=29,985 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1398kB
166. 2.692 2.692 ↓ 1.0 30,081 1

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_7 (cost=0.29..549.10 rows=30,061 width=6) (actual time=0.013..2.692 rows=30,081 loops=1)

  • Heap Fetches: 1816
167. 2.960 6.602 ↓ 1.0 19,000 1

Hash (cost=1,188.92..1,188.92 rows=18,992 width=25) (actual time=6.602..6.602 rows=19,000 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1350kB
168. 3.642 3.642 ↓ 1.0 19,000 1

Seq Scan on c_bpartner bp_5 (cost=0.00..1,188.92 rows=18,992 width=25) (actual time=0.004..3.642 rows=19,000 loops=1)

169. 16.308 76.012 ↑ 1.0 41,323 1

Hash (cost=8,053.73..8,053.73 rows=41,324 width=266) (actual time=76.012..76.012 rows=41,323 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 11358kB
170. 9.466 59.704 ↓ 1.0 41,420 1

Hash Left Join (cost=5.05..8,053.73 rows=41,324 width=266) (actual time=0.069..59.704 rows=41,420 loops=1)

  • Hash Cond: (t_5.cof_c_bankoccurrence_id = bo_3.cof_c_bankoccurrence_id)
171. 9.926 50.210 ↓ 1.0 41,420 1

Hash Left Join (cost=1.38..7,936.47 rows=41,324 width=230) (actual time=0.035..50.210 rows=41,420 loops=1)

  • Hash Cond: (t_5.cof_c_bankintegration_id = bi_3.cof_c_bankintegration_id)
172. 40.273 40.273 ↓ 1.0 41,420 1

Seq Scan on cof_titulo t_5 (cost=0.00..7,799.56 rows=41,324 width=207) (actual time=0.015..40.273 rows=41,420 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 12072
173. 0.006 0.011 ↑ 1.0 17 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
174. 0.005 0.005 ↑ 1.0 17 1

Seq Scan on cof_c_bankintegration bi_3 (cost=0.00..1.17 rows=17 width=29) (actual time=0.003..0.005 rows=17 loops=1)

175. 0.015 0.028 ↑ 1.0 74 1

Hash (cost=2.74..2.74 rows=74 width=43) (actual time=0.028..0.028 rows=74 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
176. 0.013 0.013 ↑ 1.0 74 1

Seq Scan on cof_c_bankoccurrence bo_3 (cost=0.00..2.74 rows=74 width=43) (actual time=0.003..0.013 rows=74 loops=1)

177. 4.877 29.874 ↑ 1.0 29,985 1

Hash (cost=5,734.61..5,734.61 rows=30,061 width=22) (actual time=29.874..29.874 rows=29,985 loops=1)

  • Buckets: 32768 Batches: 1 Memory Usage: 1908kB
178. 24.997 24.997 ↓ 1.0 30,081 1

Seq Scan on lbr_docfiscal df_6 (cost=0.00..5,734.61 rows=30,061 width=22) (actual time=0.006..24.997 rows=30,081 loops=1)

179. 0.003 0.007 ↑ 1.0 6 1

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

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

Seq Scan on c_bp_group bpg_3 (cost=0.00..1.06 rows=6 width=6) (actual time=0.003..0.004 rows=6 loops=1)

181.          

SubPlan (forHash Left Join)

182. 0.000 0.000 ↑ 1.0 1 34,934

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

183. 5.900 40.665 ↓ 1.0 41,420 1

Hash (cost=7,799.56..7,799.56 rows=41,324 width=16) (actual time=40.665..40.665 rows=41,420 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 2495kB
184. 34.765 34.765 ↓ 1.0 41,420 1

Seq Scan on cof_titulo t_3 (cost=0.00..7,799.56 rows=41,324 width=16) (actual time=0.019..34.765 rows=41,420 loops=1)

  • Filter: (isvalid = 'Y'::bpchar)
  • Rows Removed by Filter: 12072
185. 0.004 0.015 ↑ 1.0 17 1

Hash (cost=1.17..1.17 rows=17 width=10) (actual time=0.015..0.015 rows=17 loops=1)

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

Seq Scan on cof_c_bankintegration bai (cost=0.00..1.17 rows=17 width=10) (actual time=0.004..0.011 rows=17 loops=1)

187. 0.009 0.022 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=9) (actual time=0.022..0.022 rows=25 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
188. 0.013 0.013 ↑ 1.0 25 1

Seq Scan on cof_c_custody cu (cost=0.00..1.25 rows=25 width=9) (actual time=0.008..0.013 rows=25 loops=1)

189. 0.286 0.286 ↑ 1.0 1 143

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

  • Index Cond: ("*SELECT* 1_1".c_bpartner_id = c_bpartner_id)
190. 0.169 0.327 ↑ 1.0 1,145 1

Hash (cost=44.45..44.45 rows=1,145 width=32) (actual time=0.327..0.327 rows=1,145 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 90kB
191. 0.158 0.158 ↑ 1.0 1,145 1

Seq Scan on c_elementvalue u1_1 (cost=0.00..44.45 rows=1,145 width=32) (actual time=0.003..0.158 rows=1,145 loops=1)

192. 0.003 0.007 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=19) (actual time=0.007..0.007 rows=9 loops=1)

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

Seq Scan on c_activity ac_1 (cost=0.00..1.09 rows=9 width=19) (actual time=0.002..0.004 rows=9 loops=1)

194. 0.025 0.049 ↑ 1.0 159 1

Hash (cost=5.59..5.59 rows=159 width=32) (actual time=0.048..0.049 rows=159 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 18kB
195. 0.024 0.024 ↑ 1.0 159 1

Seq Scan on cof_c_planofinanceiro pf_1 (cost=0.00..5.59 rows=159 width=32) (actual time=0.002..0.024 rows=159 loops=1)

196. 0.001 0.114 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.43..10,374.59 rows=1 width=259) (actual time=0.114..0.114 rows=0 loops=1)

  • Join Filter: (cp.c_activity_id = ac_2.c_activity_id)
197. 0.000 0.113 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.43..10,373.39 rows=1 width=135) (actual time=0.113..0.113 rows=0 loops=1)

  • Join Filter: (u1_2.c_elementvalue_id = cp.user1_id)
198. 0.000 0.113 ↓ 0.0 0 1

Nested Loop Anti Join (cost=0.43..10,314.62 rows=1 width=116) (actual time=0.113..0.113 rows=0 loops=1)

  • Join Filter: (i_4.c_cashplanline_id = cpl.c_cashplanline_id)
199. 0.001 0.113 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.43..37.37 rows=1 width=122) (actual time=0.113..0.113 rows=0 loops=1)

200. 0.001 0.112 ↓ 0.0 0 1

Nested Loop (cost=0.14..34.87 rows=1 width=101) (actual time=0.112..0.112 rows=0 loops=1)

201. 0.105 0.105 ↑ 2.0 1 1

Seq Scan on c_cashplanline cpl (cost=0.00..29.56 rows=2 width=24) (actual time=0.039..0.105 rows=1 loops=1)

  • Filter: (datetrx = '2019-04-07'::date)
  • Rows Removed by Filter: 684
202. 0.006 0.006 ↓ 0.0 0 1

Index Scan using c_cashplan_key on c_cashplan cp (cost=0.14..2.37 rows=1 width=91) (actual time=0.006..0.006 rows=0 loops=1)

  • Index Cond: (c_cashplan_id = cpl.c_cashplan_id)
  • Filter: ((issotrx = 'Y'::bpchar) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::numeric[])))
  • Rows Removed by Filter: 1
203. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (cp.c_bpartner_id = c_bpartner_id)
204. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_invoice i_4 (cost=0.00..8,897.16 rows=110,407 width=16) (never executed)

  • Filter: (docstatus <> ALL ('{RE,VO}'::bpchar[]))
205. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_elementvalue u1_2 (cost=0.00..44.45 rows=1,145 width=32) (never executed)

206. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_activity ac_2 (cost=0.00..1.09 rows=9 width=19) (never executed)

207. 0.004 47.720 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.43..10,373.63 rows=1 width=259) (actual time=47.675..47.720 rows=1 loops=1)

  • Join Filter: (cp_1.c_activity_id = ac_3.c_activity_id)
  • Rows Removed by Join Filter: 9
208. 0.073 47.714 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.43..10,372.42 rows=1 width=135) (actual time=47.669..47.714 rows=1 loops=1)

  • Join Filter: (u1_3.c_elementvalue_id = cp_1.user1_id)
  • Rows Removed by Join Filter: 1145
209. 23.886 47.565 ↑ 1.0 1 1

Nested Loop Anti Join (cost=0.43..10,313.66 rows=1 width=116) (actual time=47.521..47.565 rows=1 loops=1)

  • Join Filter: (i_5.c_cashplanline_id = cpl_1.c_cashplanline_id)
  • Rows Removed by Join Filter: 110556
210. 0.001 0.080 ↑ 1.0 1 1

Nested Loop Left Join (cost=0.43..36.41 rows=1 width=122) (actual time=0.035..0.080 rows=1 loops=1)

211. 0.003 0.077 ↑ 1.0 1 1

Nested Loop (cost=0.14..34.37 rows=1 width=101) (actual time=0.032..0.077 rows=1 loops=1)

212. 0.064 0.064 ↑ 2.0 1 1

Seq Scan on c_cashplanline cpl_1 (cost=0.00..29.56 rows=2 width=24) (actual time=0.020..0.064 rows=1 loops=1)

  • Filter: (datetrx = '2019-04-07'::date)
  • Rows Removed by Filter: 684
213. 0.010 0.010 ↑ 1.0 1 1

Index Scan using c_cashplan_key on c_cashplan cp_1 (cost=0.14..2.37 rows=1 width=91) (actual time=0.010..0.010 rows=1 loops=1)

  • Index Cond: (c_cashplan_id = cpl_1.c_cashplan_id)
  • Filter: ((issotrx = 'N'::bpchar) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::numeric[])))
214. 0.002 0.002 ↓ 0.0 0 1

Index Scan using c_bpartner_pkey on c_bpartner bp_7 (cost=0.29..2.04 rows=1 width=34) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (cp_1.c_bpartner_id = c_bpartner_id)
215. 23.599 23.599 ↓ 1.0 110,556 1

Seq Scan on c_invoice i_5 (cost=0.00..8,897.16 rows=110,407 width=16) (actual time=0.003..23.599 rows=110,556 loops=1)

  • Filter: (docstatus <> ALL ('{RE,VO}'::bpchar[]))
  • Rows Removed by Filter: 2698
216. 0.076 0.076 ↑ 1.0 1,145 1

Seq Scan on c_elementvalue u1_3 (cost=0.00..44.45 rows=1,145 width=32) (actual time=0.010..0.076 rows=1,145 loops=1)

217. 0.002 0.002 ↑ 1.0 9 1

Seq Scan on c_activity ac_3 (cost=0.00..1.09 rows=9 width=19) (actual time=0.002..0.002 rows=9 loops=1)

218. 0.001 8.083 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..37,332.27 rows=2 width=253) (actual time=8.083..8.083 rows=0 loops=1)

  • Join Filter: (c_payment.c_activity_id = ac_4.c_activity_id)
219. 0.000 8.082 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..37,330.37 rows=2 width=144) (actual time=8.082..8.082 rows=0 loops=1)

  • Join Filter: (u1_4.c_elementvalue_id = c_payment.user1_id)
220. 0.000 8.082 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..37,248.71 rows=2 width=125) (actual time=8.082..8.082 rows=0 loops=1)

221. 0.006 8.082 ↓ 0.0 0 1

Nested Loop (cost=0.42..37,244.29 rows=2 width=103) (actual time=8.082..8.082 rows=0 loops=1)

222. 0.031 0.031 ↑ 1.0 5 1

Seq Scan on c_bankaccount ba (cost=0.00..5.46 rows=5 width=6) (actual time=0.004..0.031 rows=5 loops=1)

  • Filter: (cof_contatransitoriacredito = 'Y'::bpchar)
  • Rows Removed by Filter: 113
223. 8.045 8.045 ↓ 0.0 0 5

Index Scan using c_payment_bankaccount on c_payment (cost=0.42..7,447.76 rows=1 width=109) (actual time=1.609..1.609 rows=0 loops=5)

  • Index Cond: (c_bankaccount_id = ba.c_bankaccount_id)
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (isreceipt = 'Y'::bpchar) AND (isallocated = 'Y'::bpchar) AND (datetrx = '2019-04-07'::date) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::numeric[])) AND ((SubPlan 1) <= 0))
  • Rows Removed by Filter: 1820
224.          

SubPlan (forIndex Scan)

225. 0.000 0.000 ↓ 0.0 0

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

226. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.70..5.14 rows=1 width=7) (never executed)

227. 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=14) (never executed)

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

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

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

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

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

Materialize (cost=0.00..50.18 rows=1,145 width=32) (never executed)

231. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_elementvalue u1_4 (cost=0.00..44.45 rows=1,145 width=32) (never executed)

232. 0.000 0.000 ↓ 0.0 0

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

233. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_activity ac_4 (cost=0.00..1.09 rows=9 width=19) (never executed)

234. 0.000 3.950 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.98..1,187.06 rows=1 width=253) (actual time=3.950..3.950 rows=0 loops=1)

  • Join Filter: (p_2.c_activity_id = ac_5.c_activity_id)
235. 0.001 3.950 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.98..1,185.85 rows=1 width=123) (actual time=3.950..3.950 rows=0 loops=1)

236. 0.000 3.949 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.70..1,184.14 rows=1 width=104) (actual time=3.949..3.949 rows=0 loops=1)

237. 0.001 3.949 ↓ 0.0 0 1

Nested Loop (cost=0.42..1,182.83 rows=1 width=82) (actual time=3.949..3.949 rows=0 loops=1)

238. 3.943 3.943 ↑ 2.8 5 1

Seq Scan on cof_c_controlcheck cc (cost=0.00..1,145.79 rows=14 width=30) (actual time=1.614..3.943 rows=5 loops=1)

  • Filter: ((changedate IS NULL) AND (cof_dateresubmit2 IS NULL) AND (dateto = '2019-04-07'::date) AND (ad_client_id = '1000000'::numeric) AND (ad_org_id = ANY ('{5000007,5000003,1000001,5000006,5000005,5000002,5000001}'::numeric[])))
  • Rows Removed by Filter: 17082
239. 0.005 0.005 ↓ 0.0 0 5

Index Scan using c_payment_pkey on c_payment p_2 (cost=0.42..2.65 rows=1 width=65) (actual time=0.001..0.001 rows=0 loops=5)

  • 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))
240. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using c_elementvalue_pkey on c_elementvalue u1_5 (cost=0.28..1.71 rows=1 width=32) (never executed)

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

Seq Scan on c_activity ac_5 (cost=0.00..1.09 rows=9 width=19) (never executed)