explain.depesz.com

PostgreSQL's explain analyze made readable

Result: u7U5

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 0.028 ↑ 1.0 1 1

Aggregate (cost=69.89..69.90 rows=1 width=40) (actual time=0.028..0.028 rows=1 loops=1)

  • Buffers: shared hit=13
2. 0.000 0.013 ↓ 0.0 0 1

Nested Loop (cost=67.59..69.89 rows=1 width=48) (actual time=0.013..0.013 rows=0 loops=1)

  • Join Filter: (oi.c_doctype_id = dt.c_doctype_id)
  • Buffers: shared hit=6
3. 0.001 0.013 ↓ 0.0 0 1

Subquery Scan on oi (cost=67.44..67.51 rows=1 width=64) (actual time=0.013..0.013 rows=0 loops=1)

  • Filter: (oi.daysdue > 0)
  • Buffers: shared hit=6
4. 0.000 0.012 ↓ 0.0 0 1

HashAggregate (cost=67.44..67.47 rows=3 width=3,648) (actual time=0.012..0.012 rows=0 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
  • Buffers: shared hit=6
5. 0.001 0.012 ↓ 0.0 0 1

Append (cost=8.15..66.60 rows=3 width=3,648) (actual time=0.012..0.012 rows=0 loops=1)

  • Buffers: shared hit=6
6. 0.000 0.007 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=8.15..32.43 rows=1 width=1,278) (actual time=0.007..0.007 rows=0 loops=1)

  • Buffers: shared hit=3
7. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.15..32.42 rows=1 width=1,274) (actual time=0.007..0.007 rows=0 loops=1)

  • Join Filter: (bpg.c_bp_group_id = bp.c_bp_group_id)
  • Buffers: shared hit=3
8. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.15..27.22 rows=1 width=826) (actual time=0.007..0.007 rows=0 loops=1)

  • Join Filter: (bp.c_bpartner_id = i.c_bpartner_id)
  • Buffers: shared hit=3
9. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=7.86..24.70 rows=1 width=807) (actual time=0.007..0.007 rows=0 loops=1)

  • Buffers: shared hit=3
10. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=7.71..24.54 rows=1 width=774) (actual time=0.007..0.007 rows=0 loops=1)

  • Buffers: shared hit=3
11. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=7.58..24.38 rows=1 width=747) (actual time=0.007..0.007 rows=0 loops=1)

  • Buffers: shared hit=3
12. 0.000 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=7.16..20.87 rows=1 width=542) (actual time=0.007..0.007 rows=0 loops=1)

  • Buffers: shared hit=3
13. 0.000 0.007 ↓ 0.0 0 1

Nested Loop (cost=6.87..18.35 rows=1 width=526) (actual time=0.007..0.007 rows=0 loops=1)

  • Buffers: shared hit=3
14. 0.001 0.007 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.73..15.93 rows=1 width=517) (actual time=0.007..0.007 rows=0 loops=1)

  • Buffers: shared hit=3
15. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=6.44..13.41 rows=1 width=517) (actual time=0.006..0.006 rows=0 loops=1)

  • Buffers: shared hit=3
16. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=6.15..13.10 rows=1 width=523) (actual time=0.006..0.006 rows=0 loops=1)

  • Buffers: shared hit=3
17. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=5.86..10.60 rows=1 width=517) (actual time=0.006..0.006 rows=0 loops=1)

  • Buffers: shared hit=3
18. 0.000 0.006 ↓ 0.0 0 1

Nested Loop (cost=5.57..9.18 rows=1 width=517) (actual time=0.006..0.006 rows=0 loops=1)

  • Buffers: shared hit=3
19. 0.001 0.006 ↓ 0.0 0 1

Bitmap Heap Scan on c_invoice i (cost=5.43..6.80 rows=1 width=513) (actual time=0.006..0.006 rows=0 loops=1)

  • Recheck Cond: ((c_bpartner_id = '0'::numeric) AND (docstatus = ANY ('{CO,CL}'::bpchar[])) AND (docstatus = ''::bpchar))
  • Filter: ((ispayschedulevalid <> 'Y'::bpchar) AND (invoiceopen(c_invoice_id, '0'::numeric) <> '0'::numeric))
  • Buffers: shared hit=3
20. 0.000 0.005 ↓ 0.0 0 1

BitmapAnd (cost=5.43..5.43 rows=1 width=0) (actual time=0.005..0.005 rows=0 loops=1)

  • Buffers: shared hit=3
21. 0.005 0.005 ↓ 0.0 0 1

Bitmap Index Scan on c_invoice_documentno_target (cost=0.00..1.74 rows=29 width=0) (actual time=0.005..0.005 rows=0 loops=1)

  • Index Cond: (c_bpartner_id = '0'::numeric)
  • Buffers: shared hit=3
22. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_c_invoice_docstatus_ispayschedulevalid_issotrx (cost=0.00..3.44 rows=41 width=0) (never executed)

  • Index Cond: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (docstatus = ''::bpchar))
23. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_doctype_id = i.c_doctype_id)
24. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_bpartner_id = '0'::numeric)
  • Heap Fetches: 0
25. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_bpartner_location_id = i.c_bpartner_location_id)
26. 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
27. 0.000 0.000 ↓ 0.0 0

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

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

Index Scan using c_paymentterm_pkey on c_paymentterm p (cost=0.14..2.36 rows=1 width=15) (never executed)

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

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

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

Index Scan using idx_cof_titulo_c_invoice_id_c_invoicepayschedule_id_isvalid on cof_titulo t (cost=0.42..3.50 rows=1 width=211) (never executed)

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

Index Scan using cof_c_bankintegration_key on cof_c_bankintegration bi (cost=0.14..0.16 rows=1 width=33) (never executed)

  • Index Cond: (cof_c_bankintegration_id = t.cof_c_bankintegration_id)
32. 0.000 0.000 ↓ 0.0 0

Index Scan using cof_c_bankoccurrence_key on cof_c_bankoccurrence bo (cost=0.14..0.16 rows=1 width=40) (never executed)

  • Index Cond: (cof_c_bankoccurrence_id = t.cof_c_bankoccurrence_id)
33. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_bpartner_id = '0'::numeric)
34. 0.000 0.000 ↓ 0.0 0

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

35. 0.000 0.004 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=8.40..34.17 rows=2 width=1,205) (actual time=0.004..0.004 rows=0 loops=1)

  • Buffers: shared hit=3
36. 0.000 0.004 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.40..34.14 rows=2 width=1,177) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: (bpg_1.c_bp_group_id = bp_1.c_bp_group_id)
  • Buffers: shared hit=3
37. 0.000 0.004 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.40..26.78 rows=2 width=859) (actual time=0.004..0.004 rows=0 loops=1)

  • Buffers: shared hit=3
38. 0.000 0.004 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.26..26.45 rows=2 width=826) (actual time=0.004..0.004 rows=0 loops=1)

  • Buffers: shared hit=3
39. 0.000 0.004 ↓ 0.0 0 1

Nested Loop Left Join (cost=8.12..26.14 rows=2 width=799) (actual time=0.004..0.004 rows=0 loops=1)

  • Join Filter: (t_1.c_invoice_id = i_1.c_invoice_id)
  • Buffers: shared hit=3
40. 0.001 0.004 ↓ 0.0 0 1

Nested Loop (cost=7.70..25.14 rows=2 width=594) (actual time=0.003..0.004 rows=0 loops=1)

  • Buffers: shared hit=3
41. 0.000 0.003 ↓ 0.0 0 1

Nested Loop Left Join (cost=7.28..20.69 rows=1 width=546) (actual time=0.003..0.003 rows=0 loops=1)

  • Join Filter: (bp_1.c_bpartner_id = i_1.c_bpartner_id)
  • Buffers: shared hit=3
42. 0.000 0.003 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.99..18.17 rows=1 width=527) (actual time=0.003..0.003 rows=0 loops=1)

  • Buffers: shared hit=3
43. 0.000 0.003 ↓ 0.0 0 1

Nested Loop Left Join (cost=6.70..15.65 rows=1 width=511) (actual time=0.003..0.003 rows=0 loops=1)

  • Buffers: shared hit=3
44. 0.000 0.003 ↓ 0.0 0 1

Nested Loop (cost=6.41..13.13 rows=1 width=511) (actual time=0.003..0.003 rows=0 loops=1)

  • Buffers: shared hit=3
45. 0.000 0.003 ↓ 0.0 0 1

Nested Loop (cost=6.12..12.83 rows=1 width=517) (actual time=0.003..0.003 rows=0 loops=1)

  • Buffers: shared hit=3
46. 0.000 0.003 ↓ 0.0 0 1

Nested Loop (cost=5.84..10.32 rows=1 width=511) (actual time=0.003..0.003 rows=0 loops=1)

  • Buffers: shared hit=3
47. 0.000 0.003 ↓ 0.0 0 1

Nested Loop (cost=5.55..8.91 rows=1 width=511) (actual time=0.003..0.003 rows=0 loops=1)

  • Buffers: shared hit=3
48. 0.001 0.003 ↓ 0.0 0 1

Bitmap Heap Scan on c_invoice i_1 (cost=5.40..6.52 rows=1 width=507) (actual time=0.003..0.003 rows=0 loops=1)

  • Recheck Cond: ((c_bpartner_id = '0'::numeric) AND (docstatus = ANY ('{CO,CL}'::bpchar[])) AND (docstatus = ''::bpchar) AND (ispayschedulevalid = 'Y'::bpchar))
  • Buffers: shared hit=3
49. 0.000 0.002 ↓ 0.0 0 1

BitmapAnd (cost=5.40..5.40 rows=1 width=0) (actual time=0.002..0.002 rows=0 loops=1)

  • Buffers: shared hit=3
50. 0.002 0.002 ↓ 0.0 0 1

Bitmap Index Scan on c_invoice_documentno_target (cost=0.00..1.74 rows=29 width=0) (actual time=0.002..0.002 rows=0 loops=1)

  • Index Cond: (c_bpartner_id = '0'::numeric)
  • Buffers: shared hit=3
51. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on idx_c_invoice_docstatus_ispayschedulevalid_issotrx (cost=0.00..3.42 rows=29 width=0) (never executed)

  • Index Cond: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND (docstatus = ''::bpchar) AND (ispayschedulevalid = 'Y'::bpchar))
52. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_doctype_id = i_1.c_doctype_id)
53. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_bpartner_id = '0'::numeric)
  • Heap Fetches: 0
54. 0.000 0.000 ↓ 0.0 0

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl_1 (cost=0.29..2.51 rows=1 width=12) (never executed)

  • Index Cond: (c_bpartner_location_id = i_1.c_bpartner_location_id)
55. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_location_id = bpl_1.c_location_id)
  • Heap Fetches: 0
56. 0.000 0.000 ↓ 0.0 0

Index Only Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_3 (cost=0.29..2.51 rows=1 width=6) (never executed)

  • Index Cond: (c_invoice_id = i_1.c_invoice_id)
  • Heap Fetches: 0
57. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_lbr_docfiscal_c_invoice_id on lbr_docfiscal df_2 (cost=0.29..2.51 rows=1 width=22) (never executed)

  • Index Cond: (c_invoice_id = i_1.c_invoice_id)
58. 0.000 0.000 ↓ 0.0 0

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

  • Index Cond: (c_bpartner_id = '0'::numeric)
59. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_c_invoicepayschedule_c_invoice_id_c_invoicepayschedule_id on c_invoicepayschedule ips (cost=0.42..4.42 rows=3 width=54) (never executed)

  • Index Cond: (c_invoice_id = i_1.c_invoice_id)
  • Filter: ((isvalid = 'Y'::bpchar) AND (invoiceopen(i_1.c_invoice_id, c_invoicepayschedule_id) <> '0'::numeric))
60. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_cof_titulo_c_invoicepayschedule_id_isvalid on cof_titulo t_1 (cost=0.42..0.49 rows=1 width=217) (never executed)

  • Index Cond: ((c_invoicepayschedule_id = ips.c_invoicepayschedule_id) AND (isvalid = 'Y'::bpchar))
61. 0.000 0.000 ↓ 0.0 0

Index Scan using cof_c_bankintegration_key on cof_c_bankintegration bi_1 (cost=0.14..0.16 rows=1 width=33) (never executed)

  • Index Cond: (cof_c_bankintegration_id = t_1.cof_c_bankintegration_id)
62. 0.000 0.000 ↓ 0.0 0

Index Scan using cof_c_bankoccurrence_key on cof_c_bankoccurrence bo_1 (cost=0.14..0.16 rows=1 width=40) (never executed)

  • Index Cond: (cof_c_bankoccurrence_id = t_1.cof_c_bankoccurrence_id)
63. 0.000 0.000 ↓ 0.0 0

Materialize (cost=0.00..1.09 rows=6 width=6) (never executed)

64. 0.000 0.000 ↓ 0.0 0

Seq Scan on c_bp_group bpg_1 (cost=0.00..1.06 rows=6 width=6) (never executed)

65.          

SubPlan (for Nested Loop Left Join)

66. 0.000 0.000 ↓ 0.0 0

Result (cost=0.00..0.01 rows=1 width=32) (never executed)

67. 0.000 0.000 ↓ 0.0 0

Index Scan using idx_c_doctype_docbasetype_lbr_hasopenitems_ad_org_id_ad_client_ on c_doctype dt (cost=0.14..2.36 rows=1 width=6) (never executed)

  • Index Cond: (docbasetype = ''::bpchar)
Planning time : 14.760 ms
Execution time : 1.882 ms