explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JyOh

Settings
# exclusive inclusive rows x rows loops node
1. 0.020 4,983.367 ↓ 15.2 61 1

Limit (cost=20,826.80..20,827.26 rows=4 width=133) (actual time=4,888.089..4,983.367 rows=61 loops=1)

2. 0.000 4,983.347 ↓ 15.2 61 1

Gather Merge (cost=20,826.80..20,827.26 rows=4 width=133) (actual time=4,888.087..4,983.347 rows=61 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
3. 219.036 8,749.784 ↓ 58.5 234 2

Sort (cost=19,826.79..19,826.80 rows=4 width=133) (actual time=4,374.744..4,374.892 rows=234 loops=2)

  • Sort Key: o.dateordered DESC
  • Sort Method: quicksort Memory: 48423kB
4. 467.704 8,530.748 ↓ 36,177.2 144,709 2

Nested Loop (cost=13,892.55..19,826.75 rows=4 width=133) (actual time=109.676..4,265.374 rows=144,709 loops=2)

5. 147.872 7,194.790 ↓ 16,078.8 144,709 2

Hash Join (cost=13,890.99..19,811.08 rows=9 width=125) (actual time=109.617..3,597.395 rows=144,709 loops=2)

  • Hash Cond: (o.c_paymentterm_id = pt.c_paymentterm_id)
6. 251.502 7,046.284 ↓ 8,039.4 144,709 2

Nested Loop (cost=13,869.81..19,789.86 rows=18 width=121) (actual time=109.243..3,523.142 rows=144,709 loops=2)

7. 120.746 5,926.528 ↓ 4,134.5 144,709 2

Nested Loop (cost=13,868.25..19,729.76 rows=35 width=99) (actual time=109.204..2,963.264 rows=144,709 loops=2)

8. 15.830 4,647.234 ↓ 2,039.7 144,818 2

Nested Loop (cost=13,866.68..19,606.74 rows=71 width=78) (actual time=108.132..2,323.617 rows=144,818 loops=2)

9. 189.780 3,460.628 ↓ 620.1 146,347 2

Nested Loop Left Join (cost=13,865.11..19,192.37 rows=236 width=78) (actual time=108.075..1,730.314 rows=146,347 loops=2)

  • Filter: ((p.m_product_id IS NULL) OR (NOT (hashed SubPlan 7)))
10. 46.340 2,685.436 ↓ 309.4 146,347 2

Nested Loop (cost=13,863.69..19,044.41 rows=473 width=30) (actual time=108.036..1,342.718 rows=146,347 loops=2)

11. 50.476 870.470 ↓ 132.8 49,128 2

Nested Loop (cost=13,862.12..18,115.15 rows=370 width=12) (actual time=107.960..435.235 rows=49,128 loops=2)

12. 116.666 623.480 ↓ 66.4 49,128 2

Nested Loop (cost=13,860.69..17,032.75 rows=740 width=18) (actual time=107.922..311.740 rows=49,128 loops=2)

13. 57.490 310.300 ↓ 33.2 49,128 2

Merge Join (cost=13,859.25..14,813.43 rows=1,481 width=19) (actual time=107.879..155.150 rows=49,128 loops=2)

  • Merge Cond: (i.c_bpartner_id = b.c_bpartner_id)
14. 71.700 234.718 ↓ 16.6 49,128 2

Sort (cost=13,857.73..13,865.13 rows=2,961 width=19) (actual time=107.650..117.359 rows=49,128 loops=2)

  • Sort Key: i.c_bpartner_id
  • Sort Method: quicksort Memory: 5885kB
15. 36.060 163.018 ↓ 16.6 49,128 2

Hash Join (cost=15.05..13,687.00 rows=2,961 width=19) (actual time=0.198..81.509 rows=49,128 loops=2)

  • Hash Cond: (i.c_doctype_id = d.c_doctype_id)
16. 126.744 126.758 ↓ 1.7 59,531 2

Parallel Index Scan using idx_c_invoice_ad_client_id_ad_org_id on c_invoice i (cost=1.56..13,581.37 rows=34,442 width=25) (actual time=0.078..63.379 rows=59,531 loops=2)

  • Index Cond: ((ad_client_id = ANY ('{0,1000001}'::numeric[])) AND (ad_org_id = ANY ('{0,1000002}'::numeric[])))
  • Filter: ((docstatus = ANY ('{CO,CL}'::bpchar[])) AND ((c_invoice_id IS NULL) OR (NOT (hashed SubPlan 1))) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 2086
17.          

SubPlan (forParallel Index Scan)

18. 0.014 0.014 ↓ 0.0 0 2

Seq Scan on ad_private_access (cost=0.00..1.14 rows=1 width=7) (actual time=0.007..0.007 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '318'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
19. 0.034 0.200 ↓ 2.0 38 2

Hash (cost=13.25..13.25 rows=19 width=6) (actual time=0.100..0.100 rows=38 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
20. 0.082 0.166 ↓ 2.0 38 2

Bitmap Heap Scan on c_doctype d (cost=2.68..13.25 rows=19 width=6) (actual time=0.056..0.083 rows=38 loops=2)

  • Recheck Cond: (docbasetype = 'ARI'::bpchar)
  • Filter: ((c_doctype_id IS NULL) OR (NOT (hashed SubPlan 2)))
  • Heap Blocks: exact=9
21. 0.070 0.070 ↑ 1.0 38 2

Bitmap Index Scan on idx_c_doctype_docbasetype_lbr_hasopenitems_ad_org_id_ad_client_ (cost=0.00..1.53 rows=38 width=0) (actual time=0.035..0.035 rows=38 loops=2)

  • Index Cond: (docbasetype = 'ARI'::bpchar)
22.          

SubPlan (forBitmap Heap Scan)

23. 0.014 0.014 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_1 (cost=0.00..1.14 rows=1 width=7) (actual time=0.007..0.007 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
24. 18.078 18.092 ↓ 2.0 42,367 2

Index Only Scan using c_bpartner_pkey on c_bpartner b (cost=1.43..874.16 rows=21,226 width=6) (actual time=0.065..9.046 rows=42,367 loops=2)

  • Filter: ((c_bpartner_id IS NULL) OR (NOT (hashed SubPlan 3)))
  • Heap Fetches: 3698
25.          

SubPlan (forIndex Only Scan)

26. 0.014 0.014 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_2 (cost=0.00..1.14 rows=1 width=7) (actual time=0.007..0.007 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
27. 196.506 196.514 ↑ 1.0 1 98,257

Index Scan using c_bpartner_location_pkey on c_bpartner_location bpl (cost=1.44..1.50 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=98,257)

  • Index Cond: (c_bpartner_location_id = i.c_bpartner_location_id)
  • Filter: ((c_bpartner_location_id IS NULL) OR (NOT (hashed SubPlan 4)))
28.          

SubPlan (forIndex Scan)

29. 0.008 0.008 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_3 (cost=0.00..1.14 rows=1 width=7) (actual time=0.004..0.004 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
30. 196.508 196.514 ↑ 1.0 1 98,257

Index Only Scan using c_location_pkey on c_location loc (cost=1.44..1.46 rows=1 width=6) (actual time=0.002..0.002 rows=1 loops=98,257)

  • Index Cond: (c_location_id = bpl.c_location_id)
  • Filter: ((c_location_id IS NULL) OR (NOT (hashed SubPlan 5)))
  • Heap Fetches: 502
31.          

SubPlan (forIndex Only Scan)

32. 0.006 0.006 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_4 (cost=0.00..1.14 rows=1 width=7) (actual time=0.003..0.003 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
33. 1,768.604 1,768.626 ↑ 1.0 3 98,257

Index Scan using c_invoiceline_invoice on c_invoiceline il (cost=1.57..2.48 rows=3 width=24) (actual time=0.014..0.018 rows=3 loops=98,257)

  • Index Cond: (c_invoice_id = i.c_invoice_id)
  • Filter: (((c_invoiceline_id IS NULL) OR (NOT (hashed SubPlan 6))) AND (isdescription = 'N'::bpchar))
  • Rows Removed by Filter: 2
34.          

SubPlan (forIndex Scan)

35. 0.022 0.022 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_5 (cost=0.00..1.14 rows=1 width=7) (actual time=0.011..0.011 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
36. 585.388 585.388 ↑ 1.0 1 292,694

Index Scan using m_product_pkey on m_product p (cost=0.28..0.30 rows=1 width=60) (actual time=0.002..0.002 rows=1 loops=292,694)

  • Index Cond: (il.m_product_id = m_product_id)
37.          

SubPlan (forNested Loop Left Join)

38. 0.024 0.024 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_6 (cost=0.00..1.14 rows=1 width=7) (actual time=0.012..0.012 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
39. 1,170.768 1,170.776 ↑ 1.0 1 292,694

Index Scan using idx_lbr_docfiscal_line_c_invoiceline_id on lbr_docfiscal_line dfl (cost=1.57..1.75 rows=1 width=12) (actual time=0.003..0.004 rows=1 loops=292,694)

  • Index Cond: (c_invoiceline_id = il.c_invoiceline_id)
  • Filter: ((lbr_docfiscal_line_id IS NULL) OR (NOT (hashed SubPlan 8)))
40.          

SubPlan (forIndex Scan)

41. 0.008 0.008 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_7 (cost=0.00..1.14 rows=1 width=7) (actual time=0.004..0.004 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
42. 1,158.532 1,158.548 ↑ 1.0 1 289,637

Index Scan using c_orderline_pkey on c_orderline ol (cost=1.57..1.73 rows=1 width=33) (actual time=0.004..0.004 rows=1 loops=289,637)

  • Index Cond: (c_orderline_id = il.c_orderline_id)
  • Filter: ((c_orderline_id IS NULL) OR (NOT (hashed SubPlan 10)))
43.          

SubPlan (forIndex Scan)

44. 0.016 0.016 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_9 (cost=0.00..1.14 rows=1 width=7) (actual time=0.008..0.008 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
45. 868.244 868.254 ↑ 1.0 1 289,418

Index Scan using c_order_pkey on c_order o (cost=1.56..1.72 rows=1 width=34) (actual time=0.003..0.003 rows=1 loops=289,418)

  • Index Cond: (c_order_id = ol.c_order_id)
  • Filter: ((c_order_id IS NULL) OR (NOT (hashed SubPlan 11)))
46.          

SubPlan (forIndex Scan)

47. 0.010 0.010 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_10 (cost=0.00..1.14 rows=1 width=7) (actual time=0.005..0.005 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
48. 0.236 0.634 ↓ 2.0 429 2

Hash (cost=18.51..18.51 rows=214 width=17) (actual time=0.317..0.317 rows=429 loops=2)

  • Buckets: 1024 Batches: 1 Memory Usage: 30kB
49. 0.366 0.398 ↓ 2.0 429 2

Seq Scan on c_paymentterm pt (cost=1.14..18.51 rows=214 width=17) (actual time=0.042..0.199 rows=429 loops=2)

  • Filter: ((c_paymentterm_id IS NULL) OR (NOT (hashed SubPlan 12)))
50.          

SubPlan (forSeq Scan)

51. 0.032 0.032 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_11 (cost=0.00..1.14 rows=1 width=7) (actual time=0.016..0.016 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8
52. 868.244 868.254 ↑ 1.0 1 289,418

Index Scan using lbr_docfiscal_key on lbr_docfiscal df (cost=1.56..1.74 rows=1 width=20) (actual time=0.003..0.003 rows=1 loops=289,418)

  • Index Cond: (lbr_docfiscal_id = dfl.lbr_docfiscal_id)
  • Filter: ((lbr_docfiscal_id IS NULL) OR (NOT (hashed SubPlan 9)))
53.          

SubPlan (forIndex Scan)

54. 0.010 0.010 ↓ 0.0 0 2

Seq Scan on ad_private_access ad_private_access_8 (cost=0.00..1.14 rows=1 width=7) (actual time=0.005..0.005 rows=0 loops=2)

  • Filter: ((ad_user_id <> '1038384'::numeric) AND (ad_table_id = '0'::numeric) AND (isactive = 'Y'::bpchar))
  • Rows Removed by Filter: 8