explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FmFY

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 90.169 ↓ 4.8 224 1

Limit (cost=7,018.92..17,223.56 rows=47 width=312) (actual time=72.816..90.169 rows=224 loops=1)

2. 0.265 90.146 ↓ 4.8 224 1

Result (cost=7,018.92..17,223.56 rows=47 width=312) (actual time=72.814..90.146 rows=224 loops=1)

3. 0.152 72.727 ↓ 4.8 224 1

Sort (cost=7,018.92..7,019.03 rows=47 width=255) (actual time=72.699..72.727 rows=224 loops=1)

  • Sort Key: order0_.dateordered DESC, order0_.documentno DESC
  • Sort Method: quicksort Memory: 89kB
4. 0.286 72.575 ↓ 4.8 224 1

Nested Loop (cost=238.75..7,017.61 rows=47 width=255) (actual time=33.639..72.575 rows=224 loops=1)

5. 0.136 70.497 ↓ 4.8 224 1

Nested Loop (cost=238.19..6,886.48 rows=47 width=163) (actual time=33.623..70.497 rows=224 loops=1)

6. 0.094 69.913 ↓ 4.8 224 1

Nested Loop (cost=237.91..6,786.70 rows=47 width=158) (actual time=33.614..69.913 rows=224 loops=1)

7. 49.331 67.803 ↓ 4.8 224 1

Bitmap Heap Scan on c_order order0_ (cost=237.35..6,656.15 rows=47 width=142) (actual time=33.594..67.803 rows=224 loops=1)

  • Recheck Cond: (upper((documentno)::text) ~~ '%2552%'::text)
  • Rows Removed by Index Recheck: 2409
  • Filter: ((em_obpos_applications_id IS NOT NULL) AND ((docstatus)::text <> 'CJ'::text) AND ((docstatus)::text <> 'CA'::text) AND ((ad_client_id)::text = '9404134F8B374DEE92E79CD87B834E19'::text) AND ((ad_org_id)::text = 'C3974CB5020F4A4492DE43935497D08B'::text) AND (em_obpos_isdeleted = 'N'::bpchar) AND (((docstatus)::text <> 'CL'::text) OR (iscancelled = 'Y'::bpchar)))
  • Rows Removed by Filter: 21777
  • Heap Blocks: exact=20046
8. 18.472 18.472 ↓ 4.3 24,414 1

Bitmap Index Scan on em_obpos_order_docno_trgm (cost=0.00..237.33 rows=5,685 width=0) (actual time=18.472..18.472 rows=24,414 loops=1)

  • Index Cond: (upper((documentno)::text) ~~ '%2552%'::text)
9. 2.016 2.016 ↑ 1.0 1 224

Index Scan using c_bpartner_key on c_bpartner businesspa1_ (cost=0.56..2.78 rows=1 width=49) (actual time=0.009..0.009 rows=1 loops=224)

  • Index Cond: ((c_bpartner_id)::text = (order0_.c_bpartner_id)::text)
10. 0.448 0.448 ↑ 1.0 1 224

Index Scan using c_doctype_key on c_doctype documentty2_ (cost=0.28..2.12 rows=1 width=37) (actual time=0.002..0.002 rows=1 loops=224)

  • Index Cond: ((c_doctype_id)::text = (order0_.c_doctype_id)::text)
11. 1.792 1.792 ↑ 1.0 1 224

Index Scan using c_order_key on c_order order_comp4_ (cost=0.56..2.78 rows=1 width=39) (actual time=0.008..0.008 rows=1 loops=224)

  • Index Cond: ((c_order_id)::text = (order0_.c_order_id)::text)
12.          

SubPlan (forResult)

13. 0.448 2.912 ↑ 1.0 1 224

Aggregate (cost=185.44..185.46 rows=1 width=32) (actual time=0.012..0.013 rows=1 loops=224)

14. 2.464 2.464 ↑ 81.0 2 224

Index Scan using c_orderline_order on c_orderline ol (cost=0.57..183.00 rows=162 width=8) (actual time=0.010..0.011 rows=2 loops=224)

  • Index Cond: ((c_order_id)::text = (order_comp4_.c_order_id)::text)
  • Filter: (c_order_discount_id IS NULL)
15. 0.218 11.554 ↑ 1.0 1 218

Aggregate (cost=18.12..18.14 rows=1 width=32) (actual time=0.053..0.053 rows=1 loops=218)

16. 0.140 11.336 ↓ 2.0 2 218

Nested Loop (cost=2.27..18.11 rows=1 width=6) (actual time=0.037..0.052 rows=2 loops=218)

17. 0.480 7.848 ↓ 2.0 2 218

Nested Loop (cost=1.70..15.79 rows=1 width=39) (actual time=0.028..0.036 rows=2 loops=218)

18. 0.228 4.360 ↓ 2.0 2 218

Nested Loop (cost=1.13..13.47 rows=1 width=39) (actual time=0.019..0.020 rows=2 loops=218)

19. 1.962 1.962 ↑ 1.0 1 218

Index Scan using fin_paym_sch_ord_idx on fin_payment_schedule fps (cost=0.56..2.78 rows=1 width=33) (actual time=0.009..0.009 rows=1 loops=218)

  • Index Cond: ((c_order_id)::text = (order_comp4_.c_order_id)::text)
20. 2.170 2.170 ↑ 4.0 2 217

Index Scan using fin_pay_scheduledetail_or on fin_payment_scheduledetail fpsd (cost=0.57..10.61 rows=8 width=72) (actual time=0.009..0.010 rows=2 loops=217)

  • Index Cond: ((fin_payment_schedule_order)::text = (fps.fin_payment_schedule_id)::text)
21. 3.008 3.008 ↑ 1.0 1 376

Index Scan using fin_payment_detail_key on fin_payment_detail fpd (cost=0.57..2.32 rows=1 width=66) (actual time=0.008..0.008 rows=1 loops=376)

  • Index Cond: ((fin_payment_detail_id)::text = (fpsd.fin_payment_detail_id)::text)
22. 3.348 3.348 ↑ 1.0 1 372

Index Scan using fin_payment_key on fin_payment fp (cost=0.57..2.32 rows=1 width=33) (actual time=0.009..0.009 rows=1 loops=372)

  • Index Cond: ((fin_payment_id)::text = (fpd.fin_payment_id)::text)
  • Filter: ((status)::text <> ALL ('{RPVOID,RPAP}'::text[]))
23. 0.000 2.688 ↑ 1.0 1 224

Aggregate (cost=13.49..13.51 rows=1 width=32) (actual time=0.012..0.012 rows=1 loops=224)

24. 1.344 2.688 ↓ 2.0 2 224

Nested Loop (cost=1.13..13.49 rows=1 width=6) (actual time=0.011..0.012 rows=2 loops=224)

25. 1.344 1.344 ↑ 1.0 1 224

Index Scan using fin_paym_sch_ord_idx on fin_payment_schedule fin_paymen7_ (cost=0.56..2.78 rows=1 width=33) (actual time=0.006..0.006 rows=1 loops=224)

  • Index Cond: ((c_order_id)::text = (order0_.c_order_id)::text)
  • Filter: ((fin_payment_detail_id IS NOT NULL) AND (iscanceled = 'N'::bpchar))
  • Rows Removed by Filter: 0
Planning time : 2.398 ms
Execution time : 90.371 ms