explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WWiy

Settings
# exclusive inclusive rows x rows loops node
1. 15,940.576 738,652.428 ↓ 1.2 11,464,354 1

Hash Left Join (cost=7,524,821.26..87,634,610.14 rows=9,380,934 width=212) (actual time=168,658.585..738,652.428 rows=11,464,354 loops=1)

  • Hash Cond: (il.c_charge_id = ch.c_charge_id)
2. 15,355.553 183,882.417 ↓ 1.2 11,464,354 1

Hash Right Join (cost=7,524,654.23..8,306,113.22 rows=9,380,934 width=192) (actual time=168,652.281..183,882.417 rows=11,464,354 loops=1)

  • Hash Cond: ((uomc.c_uom_id = uom.c_uom_id) AND (uomc.c_uom_to_id = pd.c_uom_id))
3. 8.877 8.877 ↑ 1.0 15,259 1

Seq Scan on c_uom_conversion uomc (cost=0.00..379.08 rows=15,908 width=18) (actual time=0.012..8.877 rows=15,259 loops=1)

4. 15,636.283 168,517.987 ↓ 1.2 11,464,354 1

Hash (cost=7,127,430.22..7,127,430.22 rows=9,380,934 width=199) (actual time=168,517.987..168,517.987 rows=11,464,354 loops=1)

  • Buckets: 32768 (originally 32768) Batches: 2048 (originally 1024) Memory Usage: 1267703kB
5. 9,316.435 152,881.704 ↓ 1.2 11,464,354 1

Hash Left Join (cost=1,560,314.17..7,127,430.22 rows=9,380,934 width=199) (actual time=16,761.400..152,881.704 rows=11,464,354 loops=1)

  • Hash Cond: (il.c_uom_id = uom.c_uom_id)
6. 18,849.061 143,564.765 ↓ 1.2 11,464,354 1

Hash Left Join (cost=1,560,284.18..6,998,412.39 rows=9,380,934 width=199) (actual time=16,760.873..143,564.765 rows=11,464,354 loops=1)

  • Hash Cond: (il.m_product_id = pd.m_product_id)
7. 11,709.039 124,535.287 ↓ 1.2 11,464,354 1

Hash Left Join (cost=1,546,820.72..6,342,783.87 rows=9,380,934 width=193) (actual time=16,579.932..124,535.287 rows=11,464,354 loops=1)

  • Hash Cond: ((pr.m_product_category_id = prca.m_product_category_id) AND (i.ad_client_id = prca.ad_client_id))
8. 18,934.085 112,823.977 ↓ 1.2 11,464,354 1

Hash Left Join (cost=1,546,678.34..4,453,480.43 rows=9,380,934 width=198) (actual time=16,577.628..112,823.977 rows=11,464,354 loops=1)

  • Hash Cond: (il.m_product_id = pr.m_product_id)
9. 32,569.063 93,687.151 ↓ 1.2 11,464,354 1

Hash Join (cost=1,533,214.88..3,816,173.91 rows=9,380,934 width=191) (actual time=16,374.349..93,687.151 rows=11,464,354 loops=1)

  • Hash Cond: (il.c_invoice_id = i.c_invoice_id)
10. 44,751.005 44,751.005 ↑ 1.0 24,604,343 1

Seq Scan on c_invoiceline il (cost=0.00..1,314,851.32 rows=24,611,832 width=97) (actual time=2.894..44,751.005 rows=24,604,343 loops=1)

11. 884.874 16,367.083 ↓ 1.1 890,073 1

Hash (cost=1,510,024.16..1,510,024.16 rows=824,538 width=100) (actual time=16,367.083..16,367.083 rows=890,073 loops=1)

  • Buckets: 32768 Batches: 32 Memory Usage: 3788kB
12. 721.485 15,482.209 ↓ 1.1 890,073 1

Hash Left Join (cost=7,652.24..1,510,024.16 rows=824,538 width=100) (actual time=3,019.431..15,482.209 rows=890,073 loops=1)

  • Hash Cond: (c.exme_operador_id = opc.exme_operador_id)
13. 1,203.293 14,752.778 ↓ 1.1 890,073 1

Hash Left Join (cost=7,594.07..1,498,628.60 rows=824,538 width=100) (actual time=3,011.458..14,752.778 rows=890,073 loops=1)

  • Hash Cond: (i.c_cash_id = c.c_cash_id)
14. 2,028.868 10,548.002 ↓ 1.1 890,073 1

Hash Join (cost=587.61..1,454,949.98 rows=824,538 width=99) (actual time=9.310..10,548.002 rows=890,073 loops=1)

  • Hash Cond: (i.c_doctype_id = dt.c_doctype_id)
  • Join Filter: CASE WHEN ((dt.docbasetype = 'ARI'::bpchar) AND (dt.docsubtypeso IS NULL)) THEN ((NOT (SubPlan 2)) AND (i.docstatus = ANY ('{CO,CL}'::bpchar[])) AND (i.multiple_id IS NULL)) ELSE true END
  • Rows Removed by Join Filter: 756947
15. 2,785.036 5,297.280 ↑ 1.0 1,647,020 1

Hash Join (cost=6.91..384,555.40 rows=1,649,076 width=111) (actual time=0.177..5,297.280 rows=1,647,020 loops=1)

  • Hash Cond: (i.ad_client_id = sch.ad_client_id)
16. 2,512.106 2,512.106 ↑ 1.0 1,647,020 1

Seq Scan on c_invoice i (cost=0.00..361,792.33 rows=1,670,774 width=104) (actual time=0.021..2,512.106 rows=1,647,020 loops=1)

  • Filter: ((c_doctype_id > '0'::numeric) AND (issotrx = 'Y'::bpchar) AND (isactive = 'Y'::bpchar) AND (docstatus = ANY ('{CO,CL,VO,RE}'::bpchar[])))
  • Rows Removed by Filter: 514535
17. 0.034 0.138 ↑ 1.0 76 1

Hash (cost=5.96..5.96 rows=76 width=13) (actual time=0.138..0.138 rows=76 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
18. 0.104 0.104 ↑ 1.0 76 1

Seq Scan on c_acctschema sch (cost=0.00..5.96 rows=76 width=13) (actual time=0.009..0.104 rows=76 loops=1)

  • Filter: (isactive = 'Y'::bpchar)
  • Rows Removed by Filter: 1
19. 3.654 9.030 ↑ 1.1 8,961 1

Hash (cost=459.20..459.20 rows=9,720 width=13) (actual time=9.030..9.030 rows=8,961 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 513kB
20. 5.376 5.376 ↑ 1.1 8,961 1

Seq Scan on c_doctype dt (cost=0.00..459.20 rows=9,720 width=13) (actual time=0.012..5.376 rows=8,961 loops=1)

21.          

SubPlan (forHash Join)

22. 3,212.824 3,212.824 ↑ 46.0 1 803,206

Index Only Scan using c_invoice_ref_invoice_sales_id on c_invoice f (cost=0.43..9.63 rows=46 width=0) (actual time=0.004..0.004 rows=1 loops=803,206)

  • Index Cond: (ref_invoice_sales_id = i.c_invoice_id)
  • Heap Fetches: 29845
23. 48.862 3,001.483 ↓ 1.0 106,168 1

Hash (cost=5,162.65..5,162.65 rows=106,065 width=13) (actual time=3,001.483..3,001.483 rows=106,168 loops=1)

  • Buckets: 131072 Batches: 2 Memory Usage: 3429kB
24. 2,952.621 2,952.621 ↓ 1.0 106,168 1

Seq Scan on c_cash c (cost=0.00..5,162.65 rows=106,065 width=13) (actual time=0.012..2,952.621 rows=106,168 loops=1)

25. 0.570 7.946 ↑ 1.0 1,366 1

Hash (cost=40.85..40.85 rows=1,385 width=7) (actual time=7.946..7.946 rows=1,366 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 69kB
26. 7.376 7.376 ↑ 1.0 1,366 1

Seq Scan on exme_operador opc (cost=0.00..40.85 rows=1,385 width=7) (actual time=0.007..7.376 rows=1,366 loops=1)

27. 88.249 202.741 ↓ 1.0 210,428 1

Hash (cost=9,853.65..9,853.65 rows=207,665 width=13) (actual time=202.741..202.741 rows=210,428 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 3398kB
28. 114.492 114.492 ↓ 1.0 210,428 1

Seq Scan on m_product pr (cost=0.00..9,853.65 rows=207,665 width=13) (actual time=0.009..114.492 rows=210,428 loops=1)

29. 1.019 2.271 ↓ 1.0 2,459 1

Hash (cost=105.55..105.55 rows=2,455 width=15) (actual time=2.271..2.271 rows=2,459 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 144kB
30. 1.252 1.252 ↓ 1.0 2,459 1

Seq Scan on m_product_category_acct prca (cost=0.00..105.55 rows=2,455 width=15) (actual time=0.008..1.252 rows=2,459 loops=1)

31. 88.562 180.417 ↓ 1.0 210,428 1

Hash (cost=9,853.65..9,853.65 rows=207,665 width=12) (actual time=180.417..180.417 rows=210,428 loops=1)

  • Buckets: 131072 Batches: 4 Memory Usage: 3385kB
32. 91.855 91.855 ↓ 1.0 210,428 1

Seq Scan on m_product pd (cost=0.00..9,853.65 rows=207,665 width=12) (actual time=0.005..91.855 rows=210,428 loops=1)

33. 0.254 0.504 ↓ 1.0 760 1

Hash (cost=20.55..20.55 rows=755 width=6) (actual time=0.504..0.504 rows=760 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 37kB
34. 0.250 0.250 ↓ 1.0 760 1

Seq Scan on c_uom uom (cost=0.00..20.55 rows=755 width=6) (actual time=0.008..0.250 rows=760 loops=1)

35. 1.479 4.797 ↓ 1.0 3,471 1

Hash (cost=123.68..123.68 rows=3,468 width=27) (actual time=4.797..4.797 rows=3,471 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 235kB
36. 3.318 3.318 ↓ 1.0 3,471 1

Seq Scan on c_charge ch (cost=0.00..123.68 rows=3,468 width=27) (actual time=0.009..3.318 rows=3,471 loops=1)

37.          

SubPlan (forHash Left Join)

38. 11,464.354 538,824.638 ↑ 1.0 1 11,464,354

Limit (cost=0.43..8.45 rows=1 width=6) (actual time=0.047..0.047 rows=1 loops=11,464,354)

39. 527,360.284 527,360.284 ↑ 1.0 1 11,464,354

Index Scan using exme_ctapacdet_pkey on exme_ctapacdet cpd (cost=0.43..8.45 rows=1 width=6) (actual time=0.046..0.046 rows=1 loops=11,464,354)

  • Index Cond: (exme_ctapacdet_id = il.exme_ctapacdet_id)