explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NzRQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.007 1.606 ↑ 1.0 10 1

Limit (cost=192.86..192.88 rows=10 width=2,934) (actual time=1.600..1.606 rows=10 loops=1)

2.          

CTE filtered_orders

3. 0.004 0.766 ↑ 1.0 10 1

Limit (cost=148.50..148.52 rows=10 width=589) (actual time=0.762..0.766 rows=10 loops=1)

4. 0.017 0.762 ↑ 2.7 10 1

Sort (cost=148.50..148.56 rows=27 width=589) (actual time=0.761..0.762 rows=10 loops=1)

  • Sort Key: o_1.date_time_create DESC
  • Sort Method: top-N heapsort Memory: 33kB
5. 0.122 0.745 ↓ 1.1 31 1

HashAggregate (cost=147.37..147.64 rows=27 width=589) (actual time=0.738..0.745 rows=31 loops=1)

  • Group Key: o_1.id, o_1.deleted, o_1.id_ek5, o_1.number, o_1.online_shop, o_1.date_time_create
6. 0.006 0.623 ↓ 2.1 57 1

Append (cost=70.18..146.97 rows=27 width=589) (actual time=0.254..0.623 rows=57 loops=1)

7. 0.022 0.255 ↓ 1.8 24 1

Sort (cost=70.18..70.21 rows=13 width=228) (actual time=0.253..0.255 rows=24 loops=1)

  • Sort Key: o_1.date_time_create DESC
  • Sort Method: quicksort Memory: 37kB
8. 0.022 0.233 ↓ 1.8 24 1

Nested Loop (cost=0.57..69.94 rows=13 width=228) (actual time=0.043..0.233 rows=24 loops=1)

9. 0.035 0.035 ↓ 22.0 22 1

Index Scan using "idx-order_status-lang" on order_status order_status_1 (cost=0.14..2.36 rows=1 width=4) (actual time=0.019..0.035 rows=22 loops=1)

  • Index Cond: ((lang)::text = 'rus'::text)
  • Filter: ("groupCode" = 2)
  • Rows Removed by Filter: 4
10. 0.176 0.176 ↑ 59.0 1 22

Index Scan using idx_order_sender_code_order_status_code on "order" o_1 (cost=0.42..66.99 rows=59 width=232) (actual time=0.006..0.008 rows=1 loops=22)

  • Index Cond: ((order_status_code = order_status_1.code) AND ((sender_contragent_code)::text = '56090b33d83467dd84bd15ce'::text) AND (deleted = false) AND (date_time_create >= '2019-07-04 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-10-04 23:59:59'::timestamp without time zone))
  • Filter: (NOT deleted)
11. 0.021 0.166 ↓ 2.0 2 1

Nested Loop (cost=0.57..5.03 rows=1 width=228) (actual time=0.144..0.166 rows=2 loops=1)

  • Join Filter: (o_2.order_status_code = order_status_2.code)
  • Rows Removed by Join Filter: 227
12. 0.049 0.049 ↓ 12.0 12 1

Index Scan Backward using idx_order_receiver_code_number_department on "order" o_2 (cost=0.42..2.65 rows=1 width=232) (actual time=0.020..0.049 rows=12 loops=1)

  • Index Cond: (((receiver_contragent_code)::text = '56090b33d83467dd84bd15ce'::text) AND (deleted = false) AND (date_time_create >= '2019-07-04 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-10-04 23:59:59'::timestamp without time zone))
  • Filter: (NOT deleted)
13. 0.096 0.096 ↓ 19.0 19 12

Index Scan using "idx-order_status-lang" on order_status order_status_2 (cost=0.14..2.36 rows=1 width=4) (actual time=0.003..0.008 rows=19 loops=12)

  • Index Cond: ((lang)::text = 'rus'::text)
  • Filter: ("groupCode" = 2)
  • Rows Removed by Filter: 4
14. 0.020 0.196 ↓ 2.4 31 1

Sort (cost=71.29..71.33 rows=13 width=228) (actual time=0.194..0.196 rows=31 loops=1)

  • Sort Key: o_3.date_time_create DESC
  • Sort Method: quicksort Memory: 40kB
15. 0.008 0.176 ↓ 2.4 31 1

Nested Loop (cost=0.57..71.05 rows=13 width=228) (actual time=0.025..0.176 rows=31 loops=1)

16. 0.014 0.014 ↓ 22.0 22 1

Index Scan using "idx-order_status-lang" on order_status order_status_3 (cost=0.14..2.36 rows=1 width=4) (actual time=0.006..0.014 rows=22 loops=1)

  • Index Cond: ((lang)::text = 'rus'::text)
  • Filter: ("groupCode" = 2)
  • Rows Removed by Filter: 4
17. 0.154 0.154 ↑ 60.0 1 22

Index Scan using idx_order_payer_code_order_status_code on "order" o_3 (cost=0.42..68.09 rows=60 width=232) (actual time=0.005..0.007 rows=1 loops=22)

  • Index Cond: ((order_status_code = order_status_3.code) AND ((payer_contragent_code)::text = '56090b33d83467dd84bd15ce'::text) AND (deleted = false) AND (date_time_create >= '2019-07-04 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-10-04 23:59:59'::timestamp without time zone))
  • Filter: (NOT deleted)
18. 0.018 1.599 ↑ 1.0 10 1

Sort (cost=44.33..44.36 rows=10 width=2,934) (actual time=1.599..1.599 rows=10 loops=1)

  • Sort Key: o.date_time_create DESC
  • Sort Method: quicksort Memory: 30kB
19. 0.461 1.581 ↑ 1.0 10 1

Nested Loop Left Join (cost=2.48..44.17 rows=10 width=2,934) (actual time=0.951..1.581 rows=10 loops=1)

20. 0.006 1.090 ↑ 1.0 10 1

Nested Loop Left Join (cost=2.06..39.45 rows=10 width=3,065) (actual time=0.872..1.090 rows=10 loops=1)

21. 0.009 1.034 ↑ 1.0 10 1

Hash Left Join (cost=1.64..34.90 rows=10 width=3,043) (actual time=0.855..1.034 rows=10 loops=1)

  • Hash Cond: (o.straight_ek5_id = so.id_ek5)
22. 0.017 1.019 ↑ 1.0 10 1

Hash Left Join (cost=1.31..34.53 rows=10 width=2,543) (actual time=0.843..1.019 rows=10 loops=1)

  • Hash Cond: (o.reverse_ek5_id = ro.id_ek5)
23. 0.010 0.987 ↑ 1.0 10 1

Nested Loop Left Join (cost=0.99..34.16 rows=10 width=2,043) (actual time=0.818..0.987 rows=10 loops=1)

24. 0.011 0.977 ↑ 1.0 10 1

Nested Loop Left Join (cost=0.84..32.51 rows=10 width=1,527) (actual time=0.815..0.977 rows=10 loops=1)

  • Join Filter: (order_status."groupCode" = order_status_group.code)
  • Rows Removed by Join Filter: 10
25. 0.010 0.956 ↑ 1.0 10 1

Nested Loop Left Join (cost=0.84..31.25 rows=10 width=1,011) (actual time=0.799..0.956 rows=10 loops=1)

26. 0.014 0.906 ↑ 1.0 10 1

Nested Loop Left Join (cost=0.57..28.27 rows=10 width=978) (actual time=0.786..0.906 rows=10 loops=1)

27. 0.025 0.872 ↑ 1.0 10 1

Nested Loop (cost=0.42..26.63 rows=10 width=458) (actual time=0.777..0.872 rows=10 loops=1)

28. 0.767 0.767 ↑ 1.0 10 1

CTE Scan on filtered_orders t (cost=0.00..0.20 rows=10 width=16) (actual time=0.763..0.767 rows=10 loops=1)

29. 0.080 0.080 ↑ 1.0 1 10

Index Scan using "idx-order_id" on "order" o (cost=0.42..2.64 rows=1 width=474) (actual time=0.008..0.008 rows=1 loops=10)

  • Index Cond: (id = t.id)
30. 0.020 0.020 ↑ 1.0 1 10

Index Scan using "idx-order_status-code-lang" on order_status (cost=0.14..0.16 rows=1 width=524) (actual time=0.002..0.002 rows=1 loops=10)

  • Index Cond: ((o.order_status_code = code) AND ((lang)::text = 'rus'::text))
31. 0.040 0.040 ↑ 1.0 1 10

Index Scan using "idx-tariff_type-code-lang" on tariff_type (cost=0.28..0.30 rows=1 width=41) (actual time=0.004..0.004 rows=1 loops=10)

  • Index Cond: ((o.tariff_type_code = code) AND ((lang)::text = 'rus'::text))
32. 0.000 0.010 ↓ 2.0 2 10

Materialize (cost=0.00..1.12 rows=1 width=520) (actual time=0.001..0.001 rows=2 loops=10)

33. 0.010 0.010 ↓ 2.0 2 1

Seq Scan on order_status_group (cost=0.00..1.11 rows=1 width=520) (actual time=0.009..0.010 rows=2 loops=1)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 3
34. 0.000 0.000 ↓ 0.0 0 10

Index Scan using "idx-delivery_detail_additional_status-code-lang" on delivery_detail_additional_status (cost=0.14..0.16 rows=1 width=520) (actual time=0.000..0.000 rows=0 loops=10)

  • Index Cond: ((o.order_additional_status_code = code) AND ((lang)::text = 'rus'::text))
35. 0.005 0.015 ↑ 1.0 10 1

Hash (cost=0.20..0.20 rows=10 width=532) (actual time=0.015..0.015 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
36. 0.010 0.010 ↑ 1.0 10 1

CTE Scan on filtered_orders ro (cost=0.00..0.20 rows=10 width=532) (actual time=0.001..0.010 rows=10 loops=1)

37. 0.003 0.006 ↑ 1.0 10 1

Hash (cost=0.20..0.20 rows=10 width=532) (actual time=0.006..0.006 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
38. 0.003 0.003 ↑ 1.0 10 1

CTE Scan on filtered_orders so (cost=0.00..0.20 rows=10 width=532) (actual time=0.001..0.003 rows=10 loops=1)

39. 0.050 0.050 ↑ 1.0 1 10

Index Scan using "idx-city-code-lang" on city rc (cost=0.42..0.45 rows=1 width=30) (actual time=0.005..0.005 rows=1 loops=10)

  • Index Cond: ((code = o.receiver_city_code) AND ((lang)::text = 'rus'::text))
40. 0.030 0.030 ↑ 1.0 1 10

Index Scan using "idx-city-code-lang" on city sc (cost=0.42..0.45 rows=1 width=30) (actual time=0.003..0.003 rows=1 loops=10)

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