explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AKy

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.056 66.105 ↓ 6.5 13 1

Sort (cost=720.21..720.21 rows=2 width=714) (actual time=66.103..66.105 rows=13 loops=1)

  • Sort Key: a.order_num
  • Sort Method: quicksort Memory: 32kB
2. 0.068 66.049 ↓ 6.5 13 1

Nested Loop Left Join (cost=1.47..720.20 rows=2 width=714) (actual time=5.504..66.049 rows=13 loops=1)

3. 0.053 65.968 ↓ 6.5 13 1

Nested Loop Left Join (cost=1.18..718.48 rows=2 width=691) (actual time=5.484..65.968 rows=13 loops=1)

  • Join Filter: (co.courier_id = a.courier_id)
  • Rows Removed by Join Filter: 385
4. 0.040 65.876 ↓ 6.5 13 1

Nested Loop Left Join (cost=1.18..716.29 rows=2 width=672) (actual time=5.461..65.876 rows=13 loops=1)

  • Join Filter: (cu.customer_id = (a.customer_id)::numeric)
  • Rows Removed by Join Filter: 138
5. 3.068 65.719 ↓ 6.5 13 1

Nested Loop (cost=1.18..715.19 rows=2 width=636) (actual time=5.381..65.719 rows=13 loops=1)

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

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

  • Filter: ((grp_code)::text = 'active'::text)
  • Rows Removed by Filter: 6
7. 36.656 62.613 ↓ 26.2 5,274 9

Hash Join (cost=1.18..701.31 rows=201 width=326) (actual time=0.013..6.957 rows=5,274 loops=9)

  • Hash Cond: ((a.dep_id)::numeric = d.dep_id)
8. 25.938 25.938 ↓ 1.0 5,274 9

Seq Scan on cc_order a (cost=0.00..685.97 rows=5,037 width=309) (actual time=0.006..2.882 rows=5,274 loops=9)

  • Filter: ((dep_id = '37907397910465070'::bigint) AND (status_id = ANY ('{1,2,3,4,201,202,203,41074871023437782,204,205,41074790371427610,41074815851824421,40626382319388217,41076109836551615,41076264940078335}'::bigint[])))
  • Rows Removed by Filter: 3987
9. 0.006 0.019 ↓ 1.1 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 0.013 0.013 ↓ 1.1 9 1

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

11. 0.105 0.117 ↓ 5.5 11 13

Materialize (cost=0.00..1.03 rows=2 width=49) (actual time=0.006..0.009 rows=11 loops=13)

12. 0.012 0.012 ↓ 5.5 11 1

Seq Scan on crm_customer cu (cost=0.00..1.02 rows=2 width=49) (actual time=0.010..0.012 rows=11 loops=1)

13. 0.027 0.039 ↓ 1.1 30 13

Materialize (cost=0.00..1.42 rows=28 width=27) (actual time=0.001..0.003 rows=30 loops=13)

14. 0.012 0.012 ↓ 1.2 34 1

Seq Scan on cc_courier co (cost=0.00..1.28 rows=28 width=27) (actual time=0.008..0.012 rows=34 loops=1)

15. 0.013 0.013 ↓ 0.0 0 13

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=13)

  • Index Cond: (order_id = a.prev_order_id)
Planning time : 3.110 ms
Execution time : 66.248 ms