explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ECjq : Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: Optimization for: plan #8tg; plan #9rN1; plan #KO6D; plan #Jn51; plan #5S8s; plan #rQtg; plan #e8ot; plan #x1v9; plan #60x7; plan #OmB0s; plan #kT8M; plan #hBBo; plan #PBsg; plan #jWRF; plan #vUhJ; plan #guMs; plan #tNcR; plan #AIoi; plan #7xDy; plan #i9ct; plan #aXXT; plan #W38d; plan #bZt4

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.008 0.136 ↓ 0.0 0 1

Sort (cost=25.61..25.62 rows=3 width=1,499) (actual time=0.136..0.136 rows=0 loops=1)

  • Sort Key: (((o.online_shop)::json ->> 'numberDeparture'::text)) DESC
  • Sort Method: quicksort Memory: 25kB
2.          

CTE filtered_orders

3. 0.002 0.124 ↓ 0.0 0 1

Limit (cost=10.89..10.90 rows=3 width=621) (actual time=0.124..0.124 rows=0 loops=1)

4. 0.006 0.122 ↓ 0.0 0 1

Sort (cost=10.89..10.90 rows=3 width=621) (actual time=0.122..0.122 rows=0 loops=1)

  • Sort Key: (((t_1.online_shop)::json ->> 'numberDeparture'::text)) DESC
  • Sort Method: quicksort Memory: 25kB
5. 0.000 0.116 ↓ 0.0 0 1

Subquery Scan on t_1 (cost=10.78..10.86 rows=3 width=621) (actual time=0.116..0.116 rows=0 loops=1)

6. 0.002 0.116 ↓ 0.0 0 1

HashAggregate (cost=10.78..10.81 rows=3 width=589) (actual time=0.116..0.116 rows=0 loops=1)

  • Group Key: "*SELECT* 1".id, "*SELECT* 1".deleted, "*SELECT* 1".id_ek5, "*SELECT* 1".number, "*SELECT* 1".online_shop, "*SELECT* 1".date_time_create
7. 0.001 0.114 ↓ 0.0 0 1

Append (cost=3.93..10.74 rows=3 width=589) (actual time=0.114..0.114 rows=0 loops=1)

8. 0.000 0.042 ↓ 0.0 0 1

Subquery Scan on *SELECT* 1 (cost=3.93..3.95 rows=1 width=249) (actual time=0.042..0.042 rows=0 loops=1)

9. 0.006 0.042 ↓ 0.0 0 1

Sort (cost=3.93..3.94 rows=1 width=281) (actual time=0.042..0.042 rows=0 loops=1)

  • Sort Key: (((o_1.online_shop)::json ->> 'numberDeparture'::text)) DESC
  • Sort Method: quicksort Memory: 25kB
10. 0.036 0.036 ↓ 0.0 0 1

Index Scan using idx_order_sender_code_number_department on "order" o_1 (cost=0.56..3.92 rows=1 width=281) (actual time=0.036..0.036 rows=0 loops=1)

  • Index Cond: (((sender_contragent_code)::text = '56090b33d83467dd84bd15ce'::text) AND (deleted = false) AND (date_time_create >= '2019-03-12 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-03-14 23:59:59'::timestamp without time zone))
  • Filter: ((NOT deleted) AND ((number)::text = ANY ('{1105047427,1105047428}'::text[])))
11. 0.000 0.029 ↓ 0.0 0 1

Subquery Scan on *SELECT* 2 (cost=2.81..2.82 rows=1 width=249) (actual time=0.029..0.029 rows=0 loops=1)

12. 0.006 0.029 ↓ 0.0 0 1

Sort (cost=2.81..2.81 rows=1 width=281) (actual time=0.029..0.029 rows=0 loops=1)

  • Sort Key: (((o_2.online_shop)::json ->> 'numberDeparture'::text)) DESC
  • Sort Method: quicksort Memory: 25kB
13. 0.023 0.023 ↓ 0.0 0 1

Index Scan using idx_order_receiver_code_number_department on "order" o_2 (cost=0.56..2.80 rows=1 width=281) (actual time=0.023..0.023 rows=0 loops=1)

  • Index Cond: (((receiver_contragent_code)::text = '56090b33d83467dd84bd15ce'::text) AND (deleted = false) AND (date_time_create >= '2019-03-12 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-03-14 23:59:59'::timestamp without time zone))
  • Filter: ((NOT deleted) AND ((number)::text = ANY ('{1105047427,1105047428}'::text[])))
14. 0.000 0.042 ↓ 0.0 0 1

Subquery Scan on *SELECT* 3 (cost=3.93..3.95 rows=1 width=249) (actual time=0.042..0.042 rows=0 loops=1)

15. 0.012 0.042 ↓ 0.0 0 1

Sort (cost=3.93..3.94 rows=1 width=281) (actual time=0.042..0.042 rows=0 loops=1)

  • Sort Key: (((o_3.online_shop)::json ->> 'numberDeparture'::text)) DESC
  • Sort Method: quicksort Memory: 25kB
16. 0.030 0.030 ↓ 0.0 0 1

Index Scan using idx_order_payer_code_number_department on "order" o_3 (cost=0.56..3.92 rows=1 width=281) (actual time=0.030..0.030 rows=0 loops=1)

  • Index Cond: (((payer_contragent_code)::text = '56090b33d83467dd84bd15ce'::text) AND (deleted = false) AND (date_time_create >= '2019-03-12 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-03-14 23:59:59'::timestamp without time zone))
  • Filter: ((NOT deleted) AND ((number)::text = ANY ('{1105047427,1105047428}'::text[])))
17. 0.001 0.128 ↓ 0.0 0 1

Nested Loop Left Join (cost=2.30..14.69 rows=3 width=1,499) (actual time=0.128..0.128 rows=0 loops=1)

18. 0.000 0.127 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.88..12.96 rows=3 width=1,640) (actual time=0.127..0.127 rows=0 loops=1)

19. 0.000 0.127 ↓ 0.0 0 1

Hash Left Join (cost=1.46..11.29 rows=3 width=1,619) (actual time=0.127..0.127 rows=0 loops=1)

  • Hash Cond: (o.straight_ek5_id = so.id_ek5)
20. 0.001 0.127 ↓ 0.0 0 1

Hash Left Join (cost=1.36..11.17 rows=3 width=1,119) (actual time=0.127..0.127 rows=0 loops=1)

  • Hash Cond: (o.reverse_ek5_id = ro.id_ek5)
21. 0.000 0.126 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.26..11.05 rows=3 width=619) (actual time=0.126..0.126 rows=0 loops=1)

22. 0.000 0.126 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.12..10.56 rows=3 width=566) (actual time=0.126..0.126 rows=0 loops=1)

23. 0.000 0.126 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.98..9.78 rows=3 width=554) (actual time=0.126..0.126 rows=0 loops=1)

24. 0.001 0.126 ↓ 0.0 0 1

Nested Loop Left Join (cost=0.71..8.89 rows=3 width=521) (actual time=0.126..0.126 rows=0 loops=1)

25. 0.000 0.125 ↓ 0.0 0 1

Nested Loop (cost=0.56..8.40 rows=3 width=484) (actual time=0.125..0.125 rows=0 loops=1)

26. 0.125 0.125 ↓ 0.0 0 1

CTE Scan on filtered_orders t (cost=0.00..0.06 rows=3 width=16) (actual time=0.125..0.125 rows=0 loops=1)

27. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx-order_id" on "order" o (cost=0.56..2.78 rows=1 width=500) (never executed)

  • Index Cond: (id = t.id)
28. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx-order_status-code-lang" on order_status (cost=0.14..0.16 rows=1 width=41) (never executed)

  • Index Cond: ((o.order_status_code = code) AND ((lang)::text = 'rus'::text))
29. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx-tariff_type-code-lang" on tariff_type (cost=0.28..0.30 rows=1 width=41) (never executed)

  • Index Cond: ((o.tariff_type_code = code) AND ((lang)::text = 'rus'::text))
30. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx-order_status_group-code-lang" on order_status_group (cost=0.14..0.28 rows=1 width=16) (never executed)

  • Index Cond: ((order_status."groupCode" = code) AND ((lang)::text = 'rus'::text))
31. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx-delivery_detail_additional_status-code-lang" on delivery_detail_additional_status (cost=0.14..0.16 rows=1 width=57) (never executed)

  • Index Cond: ((o.order_additional_status_code = code) AND ((lang)::text = 'rus'::text))
32. 0.000 0.000 ↓ 0.0 0

Hash (cost=0.06..0.06 rows=3 width=532) (never executed)

33. 0.000 0.000 ↓ 0.0 0

CTE Scan on filtered_orders ro (cost=0.00..0.06 rows=3 width=532) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Hash (cost=0.06..0.06 rows=3 width=532) (never executed)

35. 0.000 0.000 ↓ 0.0 0

CTE Scan on filtered_orders so (cost=0.00..0.06 rows=3 width=532) (never executed)

36. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx-city-code-lang" on city rc (cost=0.42..0.56 rows=1 width=29) (never executed)

  • Index Cond: ((code = o.receiver_city_code) AND ((lang)::text = 'rus'::text))
37. 0.000 0.000 ↓ 0.0 0

Index Scan using "idx-city-code-lang" on city sc (cost=0.42..0.56 rows=1 width=29) (never executed)

  • Index Cond: ((code = o.sender_city_code) AND ((lang)::text = 'rus'::text))
Planning time : 12.785 ms
Execution time : 0.730 ms