explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5iTK : Optimization for: plan #AKy

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.085 66.216 ↓ 7.0 14 1

Sort (cost=706.87..706.87 rows=2 width=714) (actual time=66.214..66.216 rows=14 loops=1)

  • Sort Key: a.order_num
  • Sort Method: quicksort Memory: 32kB
2. 0.065 66.131 ↓ 7.0 14 1

Nested Loop Left Join (cost=111.07..706.86 rows=2 width=714) (actual time=5.360..66.131 rows=14 loops=1)

3. 0.014 66.052 ↓ 7.0 14 1

Nested Loop Left Join (cost=110.79..705.15 rows=2 width=691) (actual time=5.337..66.052 rows=14 loops=1)

4. 0.060 66.010 ↓ 7.0 14 1

Nested Loop Left Join (cost=110.65..704.83 rows=2 width=672) (actual time=5.327..66.010 rows=14 loops=1)

5. 3.336 65.922 ↓ 7.0 14 1

Nested Loop (cost=110.52..704.52 rows=2 width=636) (actual time=5.305..65.922 rows=14 loops=1)

  • Join Filter: (a.status_id = s.status_id)
  • Rows Removed by Join Filter: 47461
6. 0.027 0.027 ↓ 9.0 9 1

Seq Scan on status s (cost=0.00..11.38 rows=1 width=318) (actual time=0.011..0.027 rows=9 loops=1)

  • Filter: ((grp_code)::text = 'active'::text)
  • Rows Removed by Filter: 6
7. 37.572 62.559 ↓ 25.9 5,275 9

Hash Join (cost=110.52..690.60 rows=204 width=326) (actual time=0.364..6.951 rows=5,275 loops=9)

  • Hash Cond: ((a.dep_id)::numeric = d.dep_id)
8. 22.185 24.966 ↓ 1.0 5,275 9

Bitmap Heap Scan on cc_order a (cost=109.34..675.09 rows=5,098 width=309) (actual time=0.357..2.774 rows=5,275 loops=9)

  • Recheck Cond: (dep_id = '37907397910465070'::bigint)
  • Filter: (status_id = ANY ('{1,2,3,4,201,202,203,41074871023437782,204,205,41074790371427610,41074815851824421,40626382319388217,41076109836551615,41076264940078335}'::bigint[]))
  • Heap Blocks: exact=3600
9. 2.781 2.781 ↑ 1.0 5,275 9

Bitmap Index Scan on cc_order_idx_dep (cost=0.00..108.06 rows=5,304 width=0) (actual time=0.309..0.309 rows=5,275 loops=9)

  • Index Cond: (dep_id = '37907397910465070'::bigint)
10. 0.013 0.021 ↓ 1.1 9 1

Hash (cost=1.08..1.08 rows=8 width=28) (actual time=0.021..0.021 rows=9 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
11. 0.008 0.008 ↓ 1.1 9 1

Seq Scan on org_dep d (cost=0.00..1.08 rows=8 width=28) (actual time=0.006..0.008 rows=9 loops=1)

12. 0.028 0.028 ↓ 0.0 0 14

Index Scan using crm_customer_pk on crm_customer cu (cost=0.13..0.15 rows=1 width=49) (actual time=0.002..0.002 rows=0 loops=14)

  • Index Cond: (customer_id = (a.customer_id)::numeric)
13. 0.028 0.028 ↓ 0.0 0 14

Index Scan using cc_courier_pk on cc_courier co (cost=0.14..0.16 rows=1 width=27) (actual time=0.002..0.002 rows=0 loops=14)

  • Index Cond: (courier_id = a.courier_id)
14. 0.014 0.014 ↓ 0.0 0 14

Index Scan using cc_order_pk on cc_order prev (cost=0.29..0.64 rows=1 width=14) (actual time=0.001..0.001 rows=0 loops=14)

  • Index Cond: (order_id = a.prev_order_id)