explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HHFA

Settings
# exclusive inclusive rows x rows loops node
1. 11.200 2,890.203 ↓ 21.0 21 1

Hash Right Join (cost=86,079.90..90,040.21 rows=1 width=1,387) (actual time=2,890.051..2,890.203 rows=21 loops=1)

  • Hash Cond: (inv.c_invoiceline_id = il.c_invoiceline_id)
2. 103.079 111.903 ↓ 1.0 150,867 1

HashAggregate (cost=6,000.77..7,885.24 rows=150,757 width=38) (actual time=70.499..111.903 rows=150,867 loops=1)

  • Group Key: inv.c_invoiceline_id
3. 8.824 8.824 ↓ 1.0 151,054 1

Seq Scan on m_matchinv inv (cost=0.00..5,245.85 rows=150,985 width=11) (actual time=0.006..8.824 rows=151,054 loops=1)

4. 0.056 2,767.100 ↓ 21.0 21 1

Hash (cost=80,079.11..80,079.11 rows=1 width=643) (actual time=2,767.100..2,767.100 rows=21 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 15kB
5. 0.166 2,767.044 ↓ 21.0 21 1

Nested Loop Left Join (cost=45,037.53..80,079.11 rows=1 width=643) (actual time=984.923..2,767.044 rows=21 loops=1)

  • Join Filter: (cl.m_product_classification_id = il.m_product_classification_id)
  • Rows Removed by Join Filter: 987
6. 0.032 2,766.815 ↓ 21.0 21 1

Nested Loop Left Join (cost=45,037.53..80,077.05 rows=1 width=636) (actual time=984.912..2,766.815 rows=21 loops=1)

  • Join Filter: (il.m_product_id = po.m_product_id)
7. 0.039 2,766.699 ↓ 21.0 21 1

Nested Loop Left Join (cost=45,037.11..80,068.60 rows=1 width=619) (actual time=984.903..2,766.699 rows=21 loops=1)

8. 0.044 2,766.576 ↓ 21.0 21 1

Nested Loop Left Join (cost=45,036.69..80,060.16 rows=1 width=477) (actual time=984.894..2,766.576 rows=21 loops=1)

  • Join Filter: (il.m_product_id = p.m_product_id)
9. 0.056 2,766.406 ↓ 21.0 21 1

Nested Loop Left Join (cost=45,036.27..80,051.71 rows=1 width=426) (actual time=984.880..2,766.406 rows=21 loops=1)

10. 37.081 2,766.266 ↓ 21.0 21 1

Nested Loop (cost=45,036.12..80,051.54 rows=1 width=428) (actual time=984.871..2,766.266 rows=21 loops=1)

  • Join Filter: (il.c_invoice_id = i.c_invoice_id)
  • Rows Removed by Join Filter: 402,018
11. 49.846 916.538 ↓ 131.0 131 1

Hash Right Join (cost=40,874.12..59,784.50 rows=1 width=328) (actual time=916.443..916.538 rows=131 loops=1)

  • Hash Cond: (cd1.m_inoutline_id = il.m_inoutline_id)
12. 813.187 866.160 ↓ 1.0 675,998 1

HashAggregate (cost=40,747.69..50,613.98 rows=657,752 width=70) (actual time=527.039..866.160 rows=675,998 loops=1)

  • Group Key: cd1.m_inoutline_id
13. 52.973 52.973 ↓ 1.0 824,243 1

Seq Scan on m_costdetail cd1 (cost=0.00..34,566.54 rows=824,154 width=18) (actual time=0.013..52.973 rows=824,243 loops=1)

14. 0.130 0.532 ↓ 131.0 131 1

Hash (cost=126.41..126.41 rows=1 width=264) (actual time=0.532..0.532 rows=131 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 31kB
15. 0.402 0.402 ↓ 131.0 131 1

Index Scan using c_invoiceline_product on c_invoiceline il (cost=0.42..126.41 rows=1 width=264) (actual time=0.049..0.402 rows=131 loops=1)

  • Index Cond: (m_product_id = '1780325'::numeric)
  • Filter: (ad_client_id = '1000057'::numeric)
16. 90.197 1,812.647 ↓ 1.1 3,069 131

Hash Join (cost=4,162.00..20,232.73 rows=2,745 width=106) (actual time=0.199..13.837 rows=3,069 loops=131)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
17. 108.243 1,722.126 ↓ 1.1 3,069 131

Hash Join (cost=4,097.21..20,160.71 rows=2,745 width=102) (actual time=0.196..13.146 rows=3,069 loops=131)

  • Hash Cond: (i.c_bpartner_id = b.c_bpartner_id)
18. 87.201 1,602.392 ↓ 1.1 3,069 131

Hash Join (cost=2,276.63..18,302.38 rows=2,745 width=89) (actual time=0.108..12.232 rows=3,069 loops=131)

  • Hash Cond: (bpl_1.c_location_id = loc.c_location_id)
19. 100.985 1,511.871 ↓ 1.1 3,069 131

Hash Left Join (cost=1,522.32..17,540.87 rows=2,745 width=95) (actual time=0.082..11.541 rows=3,069 loops=131)

  • Hash Cond: (bpl_1.c_location_id = bpl.c_location_id)
20. 96.060 1,405.761 ↓ 1.1 3,069 131

Hash Join (cost=704.39..16,715.74 rows=2,745 width=77) (actual time=0.042..10.731 rows=3,069 loops=131)

  • Hash Cond: (i.c_bpartner_location_id = bpl_1.c_bpartner_location_id)
21. 1,305.415 1,305.415 ↓ 1.1 3,069 131

Index Scan using c_invoice_paid on c_invoice i (cost=0.42..16,004.56 rows=2,745 width=78) (actual time=0.009..9.965 rows=3,069 loops=131)

  • Index Cond: ((dateinvoiced > '2020-08-01 00:00:00'::timestamp without time zone) AND (dateinvoiced < '2020-08-30 00:00:00'::timestamp without time zone))
22. 1.914 4.286 ↓ 1.0 16,444 1

Hash (cost=498.43..498.43 rows=16,443 width=12) (actual time=4.286..4.286 rows=16,444 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 995kB
23. 2.372 2.372 ↓ 1.0 16,444 1

Seq Scan on c_bpartner_location bpl_1 (cost=0.00..498.43 rows=16,443 width=12) (actual time=0.004..2.372 rows=16,444 loops=1)

24. 2.596 5.125 ↓ 1.0 19,420 1

Hash (cost=575.19..575.19 rows=19,419 width=24) (actual time=5.125..5.125 rows=19,420 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 1,151kB
25. 2.529 2.529 ↓ 1.0 19,420 1

Seq Scan on c_location bpl (cost=0.00..575.19 rows=19,419 width=24) (actual time=0.003..2.529 rows=19,420 loops=1)

26. 1.942 3.320 ↓ 1.0 19,420 1

Hash (cost=511.57..511.57 rows=19,419 width=6) (actual time=3.320..3.320 rows=19,420 loops=1)

  • Buckets: 32,768 Batches: 1 Memory Usage: 996kB
27. 1.378 1.378 ↓ 1.0 19,420 1

Index Only Scan using c_location_pkey on c_location loc (cost=0.29..511.57 rows=19,419 width=6) (actual time=0.013..1.378 rows=19,420 loops=1)

  • Heap Fetches: 41
28. 1.902 11.491 ↓ 1.0 15,803 1

Hash (cost=1,623.06..1,623.06 rows=15,802 width=25) (actual time=11.491..11.491 rows=15,803 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 946kB
29. 4.466 9.589 ↓ 1.0 15,803 1

Hash Join (cost=889.54..1,623.06 rows=15,802 width=25) (actual time=4.256..9.589 rows=15,803 loops=1)

  • Hash Cond: (b.c_bpartner_id = bp.c_bpartner_id)
30. 0.877 0.877 ↓ 1.0 15,803 1

Seq Scan on c_bpartner b (cost=0.00..692.02 rows=15,802 width=12) (actual time=0.003..0.877 rows=15,803 loops=1)

31. 1.673 4.246 ↓ 1.0 15,803 1

Hash (cost=692.02..692.02 rows=15,802 width=13) (actual time=4.246..4.246 rows=15,803 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 730kB
32. 2.573 2.573 ↓ 1.0 15,803 1

Seq Scan on c_bpartner bp (cost=0.00..692.02 rows=15,802 width=13) (actual time=0.002..2.573 rows=15,803 loops=1)

33. 0.145 0.324 ↑ 1.0 1,324 1

Hash (cost=48.24..48.24 rows=1,324 width=10) (actual time=0.324..0.324 rows=1,324 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 72kB
34. 0.179 0.179 ↑ 1.0 1,324 1

Seq Scan on c_doctype d (cost=0.00..48.24 rows=1,324 width=10) (actual time=0.009..0.179 rows=1,324 loops=1)

35. 0.084 0.084 ↑ 1.0 1 21

Index Scan using c_country_pkey on c_country country (cost=0.14..0.16 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=21)

  • Index Cond: (c_country_id = bpl.c_country_id)
36. 0.126 0.126 ↑ 1.0 1 21

Index Scan using m_product_idx3 on m_product p (cost=0.42..8.44 rows=1 width=57) (actual time=0.006..0.006 rows=1 loops=21)

  • Index Cond: (m_product_id = '1780325'::numeric)
37. 0.084 0.084 ↑ 1.0 1 21

Index Scan using m_attributesetinstance_idx1 on m_attributesetinstance pasi (cost=0.42..8.44 rows=1 width=148) (actual time=0.004..0.004 rows=1 loops=21)

  • Index Cond: (m_attributesetinstance_id = il.m_attributesetinstance_id)
38. 0.084 0.084 ↓ 0.0 0 21

Index Scan using m_product_po_idx2 on m_product_po po (cost=0.42..8.44 rows=1 width=23) (actual time=0.004..0.004 rows=0 loops=21)

  • Index Cond: (m_product_id = '1780325'::numeric)
  • Filter: (iscurrentvendor = 'Y'::bpchar)
39. 0.063 0.063 ↑ 1.0 47 21

Seq Scan on m_product_classification cl (cost=0.00..1.47 rows=47 width=19) (actual time=0.001..0.003 rows=47 loops=21)