explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fOzK

Settings
# exclusive inclusive rows x rows loops node
1. 0.033 0.362 ↓ 6.5 13 1

Sort (cost=520.52..520.52 rows=2 width=714) (actual time=0.361..0.362 rows=13 loops=1)

  • Sort Key: a.order_num
  • Sort Method: quicksort Memory: 31kB
2. 0.027 0.329 ↓ 6.5 13 1

Nested Loop Left Join (cost=1.75..520.51 rows=2 width=714) (actual time=0.127..0.329 rows=13 loops=1)

3. 0.049 0.302 ↓ 6.5 13 1

Nested Loop Left Join (cost=1.47..518.80 rows=2 width=691) (actual time=0.121..0.302 rows=13 loops=1)

  • Join Filter: (co.courier_id = a.courier_id)
  • Rows Removed by Join Filter: 366
4. 0.022 0.214 ↓ 6.5 13 1

Nested Loop Left Join (cost=1.47..516.61 rows=2 width=672) (actual time=0.097..0.214 rows=13 loops=1)

  • Join Filter: (cu.customer_id = (a.customer_id)::numeric)
  • Rows Removed by Join Filter: 143
5. 0.023 0.166 ↓ 6.5 13 1

Hash Join (cost=1.47..515.51 rows=2 width=636) (actual time=0.083..0.166 rows=13 loops=1)

  • Hash Cond: ((a.dep_id)::numeric = d.dep_id)
6. 0.030 0.129 ↑ 3.5 13 1

Nested Loop (cost=0.29..514.21 rows=46 width=619) (actual time=0.059..0.129 rows=13 loops=1)

7. 0.018 0.018 ↓ 9.0 9 1

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

  • Filter: ((grp_code)::text = 'active'::text)
  • Rows Removed by Filter: 6
8. 0.081 0.081 ↑ 1,003.0 1 9

Index Scan using cc_order_idx_status on cc_order a (cost=0.29..492.80 rows=1,003 width=309) (actual time=0.007..0.009 rows=1 loops=9)

  • Index Cond: ((status_id = s.status_id) AND (status_id = ANY ('{1,2,3,4,41074790371427610,41074815851824421,202,41074871023437782,40626382319388217,204,41076109836551615,41076264940078335}'::bigint[])))
  • Filter: ((dep_id = '37907397910465070'::bigint) AND ((deliver_time IS NULL) OR ((deliver_time IS NOT NULL) AND ((date_part('epoch'::text, ((deliver_time)::timestamp with time zone - now())) / '60'::double precision) <= '120'::double precision)) OR ((s.grp_code)::text = 'deactive'::text)))
  • Rows Removed by Filter: 1
9. 0.006 0.014 ↓ 1.1 9 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
10. 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.007..0.008 rows=9 loops=1)

11. 0.018 0.026 ↓ 5.5 11 13

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

12. 0.008 0.008 ↓ 5.5 11 1

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

13. 0.027 0.039 ↑ 1.0 28 13

Materialize (cost=0.00..1.42 rows=28 width=27) (actual time=0.001..0.003 rows=28 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.007..0.012 rows=34 loops=1)

15. 0.000 0.000 ↓ 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.000..0.000 rows=0 loops=13)

  • Index Cond: (order_id = a.prev_order_id)