explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8tg

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 2.085 89.042 ↑ 1.0 10 1

Limit (cost=78,488.93..78,488.95 rows=10 width=6,377) (actual time=86.959..89.042 rows=10 loops=1)

2. 0.020 86.957 ↑ 983.5 10 1

Sort (cost=78,488.93..78,513.51 rows=9,835 width=6,377) (actual time=86.956..86.957 rows=10 loops=1)

  • Sort Key: o.date_time_create DESC
  • Sort Method: top-N heapsort Memory: 32kB
3. 0.199 86.937 ↑ 427.6 23 1

HashAggregate (cost=78,079.70..78,178.05 rows=9,835 width=6,377) (actual time=86.862..86.937 rows=23 loops=1)

  • Group Key: o.date_time_create, (to_char(o.date_time_create, 'DD.MM.YYYY'::text)), (''::text), (''::text), rc.name, sc.name, (((o.online_shop)::json ->> 'numberDeparture'::text)), o.number, (((o.packages)::json #>> '{0,description}'::text[])), o.payer_contragent_code, o.sender_contragent_code, o.receiver_contragent_code, ro.number, o.order_status_code, order_status.name, o.order_additional_status_code, delivery_detail_additional_status.name, order_status."groupCode", order_status_group.name, so.number, tariff_type.name, o.order_type_code, tariff_type.urgency
4. 0.000 86.738 ↑ 234.2 42 1

Append (cost=1,543.88..77,514.18 rows=9,835 width=6,377) (actual time=16.190..86.738 rows=42 loops=1)

5. 13.393 43.720 ↑ 272.1 18 1

Gather (cost=1,543.88..38,356.99 rows=4,898 width=1,949) (actual time=16.189..43.720 rows=18 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
6. 0.552 30.327 ↑ 395.0 4 4

Nested Loop Left Join (cost=543.88..36,867.19 rows=1,580 width=1,949) (actual time=17.267..30.327 rows=4 loops=4)

7. 0.345 29.768 ↑ 393.8 4 4

Nested Loop Left Join (cost=543.44..33,851.16 rows=1,575 width=2,426) (actual time=16.923..29.768 rows=4 loops=4)

8. 0.027 29.415 ↑ 392.2 4 4

Hash Left Join (cost=543.01..30,874.17 rows=1,569 width=2,577) (actual time=16.699..29.415 rows=4 loops=4)

  • Hash Cond: (o.order_additional_status_code = delivery_detail_additional_status.code)
9. 0.028 29.335 ↑ 392.2 4 4

Hash Left Join (cost=540.64..30,867.67 rows=1,569 width=2,061) (actual time=16.624..29.335 rows=4 loops=4)

  • Hash Cond: (o.tariff_type_code = tariff_type.code)
10. 0.016 29.006 ↑ 392.2 4 4

Nested Loop Left Join (cost=513.93..30,836.77 rows=1,569 width=2,028) (actual time=16.300..29.006 rows=4 loops=4)

11. 0.020 28.988 ↑ 392.2 4 4

Nested Loop Left Join (cost=513.36..26,504.05 rows=1,569 width=2,034) (actual time=16.289..28.988 rows=4 loops=4)

12. 0.149 28.966 ↑ 392.2 4 4

Hash Left Join (cost=512.80..22,171.32 rows=1,569 width=2,040) (actual time=16.278..28.966 rows=4 loops=4)

  • Hash Cond: (o.order_status_code = order_status.code)
13. 22.665 28.602 ↑ 392.2 4 4

Parallel Bitmap Heap Scan on "order" o (cost=509.30..22,161.74 rows=1,569 width=1,004) (actual time=15.922..28.602 rows=4 loops=4)

  • Recheck Cond: ((sender_contragent_code)::text = '56090b33d83467dd84bd15ce'::text)
  • Filter: ((NOT deleted) AND (date_time_create >= '2019-08-07 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-09-07 23:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 5530
  • Heap Blocks: exact=5136
14. 5.937 5.937 ↓ 1.1 22,140 1

Bitmap Index Scan on idx_order_sender_code (cost=0.00..508.09 rows=19,710 width=0) (actual time=5.937..5.937 rows=22,140 loops=1)

  • Index Cond: ((sender_contragent_code)::text = '56090b33d83467dd84bd15ce'::text)
15. 0.027 0.215 ↓ 26.0 26 4

Hash (cost=3.49..3.49 rows=1 width=1,040) (actual time=0.215..0.215 rows=26 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
16. 0.132 0.188 ↓ 26.0 26 4

Nested Loop Left Join (cost=0.14..3.49 rows=1 width=1,040) (actual time=0.080..0.188 rows=26 loops=4)

  • Join Filter: (order_status."groupCode" = order_status_group.code)
  • Rows Removed by Join Filter: 29
17. 0.053 0.053 ↓ 26.0 26 4

Index Scan using "idx-order_status-lang" on order_status (cost=0.14..2.36 rows=1 width=524) (actual time=0.043..0.053 rows=26 loops=4)

  • Index Cond: ((lang)::text = 'rus'::text)
18. 0.003 0.003 ↓ 2.0 2 104

Seq Scan on order_status_group (cost=0.00..1.11 rows=1 width=520) (actual time=0.002..0.003 rows=2 loops=104)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 3
19. 0.002 0.002 ↓ 0.0 0 18

Index Scan using "idx-order_id_ek5" on "order" ro (cost=0.56..2.76 rows=1 width=26) (actual time=0.002..0.002 rows=0 loops=18)

  • Index Cond: (o.reverse_ek5_id = id_ek5)
20. 0.002 0.002 ↓ 0.0 0 18

Index Scan using "idx-order_id_ek5" on "order" so (cost=0.56..2.76 rows=1 width=26) (actual time=0.002..0.002 rows=0 loops=18)

  • Index Cond: (o.straight_ek5_id = id_ek5)
21. 0.103 0.301 ↑ 1.0 282 4

Hash (cost=23.19..23.19 rows=282 width=41) (actual time=0.301..0.301 rows=282 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
22. 0.148 0.198 ↑ 1.0 282 4

Bitmap Heap Scan on tariff_type (cost=4.66..23.19 rows=282 width=41) (actual time=0.061..0.198 rows=282 loops=4)

  • Recheck Cond: ((lang)::text = 'rus'::text)
  • Heap Blocks: exact=15
23. 0.050 0.050 ↑ 1.0 282 4

Bitmap Index Scan on "idx-tariff_type-lang" (cost=0.00..4.59 rows=282 width=0) (actual time=0.049..0.050 rows=282 loops=4)

  • Index Cond: ((lang)::text = 'rus'::text)
24. 0.016 0.053 ↓ 27.0 27 4

Hash (cost=2.36..2.36 rows=1 width=520) (actual time=0.053..0.053 rows=27 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
25. 0.037 0.037 ↓ 27.0 27 4

Index Scan using "idx-delivery_detail_additional_status-lang" on delivery_detail_additional_status (cost=0.14..2.36 rows=1 width=520) (actual time=0.020..0.037 rows=27 loops=4)

  • Index Cond: ((lang)::text = 'rus'::text)
26. 0.008 0.008 ↑ 1.0 1 18

Index Scan using "idx-city-code-lang" on city rc (cost=0.43..1.90 rows=1 width=29) (actual time=0.008..0.008 rows=1 loops=18)

  • Index Cond: ((code = (((o.receiver)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
27. 0.007 0.007 ↑ 1.0 1 18

Index Scan using "idx-city-code-lang" on city sc (cost=0.43..1.90 rows=1 width=29) (actual time=0.007..0.007 rows=1 loops=18)

  • Index Cond: ((code = (((o.sender)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
28. 0.057 0.464 ↑ 39.0 1 1

Nested Loop Left Join (cost=29.55..638.38 rows=39 width=1,949) (actual time=0.400..0.464 rows=1 loops=1)

29. 0.040 0.403 ↑ 39.0 1 1

Nested Loop Left Join (cost=29.12..534.25 rows=39 width=2,426) (actual time=0.339..0.403 rows=1 loops=1)

30. 0.006 0.355 ↑ 39.0 1 1

Nested Loop Left Join (cost=28.69..430.81 rows=39 width=2,577) (actual time=0.291..0.355 rows=1 loops=1)

  • Join Filter: (o_1.order_additional_status_code = delivery_detail_additional_status_1.code)
  • Rows Removed by Join Filter: 27
31. 0.011 0.323 ↑ 39.0 1 1

Hash Left Join (cost=28.54..427.86 rows=39 width=2,061) (actual time=0.259..0.323 rows=1 loops=1)

  • Hash Cond: (o_1.tariff_type_code = tariff_type_1.code)
32. 0.003 0.160 ↑ 39.0 1 1

Nested Loop Left Join (cost=1.83..401.04 rows=39 width=2,028) (actual time=0.097..0.160 rows=1 loops=1)

33. 0.005 0.156 ↑ 39.0 1 1

Nested Loop Left Join (cost=1.27..292.62 rows=39 width=2,034) (actual time=0.092..0.156 rows=1 loops=1)

34. 0.013 0.150 ↑ 39.0 1 1

Nested Loop Left Join (cost=0.71..184.20 rows=39 width=2,040) (actual time=0.086..0.150 rows=1 loops=1)

  • Join Filter: (o_1.order_status_code = order_status_1.code)
  • Rows Removed by Join Filter: 25
35. 0.054 0.054 ↑ 39.0 1 1

Index Scan using idx_order_receiver_code on "order" o_1 (cost=0.56..180.13 rows=39 width=1,004) (actual time=0.050..0.054 rows=1 loops=1)

  • Index Cond: ((receiver_contragent_code)::text = '56090b33d83467dd84bd15ce'::text)
  • Filter: ((NOT deleted) AND (date_time_create >= '2019-08-07 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-09-07 23:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 11
36. 0.009 0.083 ↓ 26.0 26 1

Materialize (cost=0.14..3.49 rows=1 width=1,040) (actual time=0.026..0.083 rows=26 loops=1)

37. 0.034 0.074 ↓ 26.0 26 1

Nested Loop Left Join (cost=0.14..3.49 rows=1 width=1,040) (actual time=0.022..0.074 rows=26 loops=1)

  • Join Filter: (order_status_1."groupCode" = order_status_group_1.code)
  • Rows Removed by Join Filter: 29
38. 0.014 0.014 ↓ 26.0 26 1

Index Scan using "idx-order_status-lang" on order_status order_status_1 (cost=0.14..2.36 rows=1 width=524) (actual time=0.009..0.014 rows=26 loops=1)

  • Index Cond: ((lang)::text = 'rus'::text)
39. 0.026 0.026 ↓ 2.0 2 26

Seq Scan on order_status_group order_status_group_1 (cost=0.00..1.11 rows=1 width=520) (actual time=0.001..0.001 rows=2 loops=26)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 3
40. 0.001 0.001 ↓ 0.0 0 1

Index Scan using "idx-order_id_ek5" on "order" ro_1 (cost=0.56..2.78 rows=1 width=26) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (o_1.reverse_ek5_id = id_ek5)
41. 0.001 0.001 ↓ 0.0 0 1

Index Scan using "idx-order_id_ek5" on "order" so_1 (cost=0.56..2.78 rows=1 width=26) (actual time=0.001..0.001 rows=0 loops=1)

  • Index Cond: (o_1.straight_ek5_id = id_ek5)
42. 0.043 0.152 ↑ 1.0 282 1

Hash (cost=23.19..23.19 rows=282 width=41) (actual time=0.152..0.152 rows=282 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
43. 0.089 0.109 ↑ 1.0 282 1

Bitmap Heap Scan on tariff_type tariff_type_1 (cost=4.66..23.19 rows=282 width=41) (actual time=0.027..0.109 rows=282 loops=1)

  • Recheck Cond: ((lang)::text = 'rus'::text)
  • Heap Blocks: exact=15
44. 0.020 0.020 ↑ 1.0 282 1

Bitmap Index Scan on "idx-tariff_type-lang" (cost=0.00..4.59 rows=282 width=0) (actual time=0.020..0.020 rows=282 loops=1)

  • Index Cond: ((lang)::text = 'rus'::text)
45. 0.009 0.026 ↓ 27.0 27 1

Materialize (cost=0.14..2.37 rows=1 width=520) (actual time=0.010..0.026 rows=27 loops=1)

46. 0.017 0.017 ↓ 27.0 27 1

Index Scan using "idx-delivery_detail_additional_status-lang" on delivery_detail_additional_status delivery_detail_additional_status_1 (cost=0.14..2.36 rows=1 width=520) (actual time=0.009..0.017 rows=27 loops=1)

  • Index Cond: ((lang)::text = 'rus'::text)
47. 0.008 0.008 ↑ 1.0 1 1

Index Scan using "idx-city-code-lang" on city rc_1 (cost=0.43..2.65 rows=1 width=29) (actual time=0.008..0.008 rows=1 loops=1)

  • Index Cond: ((code = (((o_1.receiver)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
48. 0.004 0.004 ↑ 1.0 1 1

Index Scan using "idx-city-code-lang" on city sc_1 (cost=0.43..2.65 rows=1 width=29) (actual time=0.004..0.004 rows=1 loops=1)

  • Index Cond: ((code = (((o_1.sender)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
49. 12.240 44.586 ↑ 213.0 23 1

Gather (cost=1,558.18..38,371.29 rows=4,898 width=1,949) (actual time=14.853..44.586 rows=23 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
50. 0.557 32.346 ↑ 263.3 6 4

Nested Loop Left Join (cost=558.18..36,881.49 rows=1,580 width=1,949) (actual time=13.110..32.346 rows=6 loops=4)

51. 0.348 31.784 ↑ 262.5 6 4

Nested Loop Left Join (cost=557.74..33,865.46 rows=1,575 width=2,426) (actual time=12.844..31.784 rows=6 loops=4)

52. 0.030 31.429 ↑ 261.5 6 4

Hash Left Join (cost=557.31..30,888.47 rows=1,569 width=2,577) (actual time=12.663..31.429 rows=6 loops=4)

  • Hash Cond: (o_2.order_additional_status_code = delivery_detail_additional_status_2.code)
53. 0.032 31.345 ↑ 261.5 6 4

Hash Left Join (cost=554.94..30,881.97 rows=1,569 width=2,061) (actual time=12.584..31.345 rows=6 loops=4)

  • Hash Cond: (o_2.tariff_type_code = tariff_type_2.code)
54. 0.017 31.004 ↑ 261.5 6 4

Nested Loop Left Join (cost=528.23..30,851.07 rows=1,569 width=2,028) (actual time=12.251..31.004 rows=6 loops=4)

55. 0.024 30.986 ↑ 261.5 6 4

Nested Loop Left Join (cost=527.66..26,518.35 rows=1,569 width=2,034) (actual time=12.240..30.986 rows=6 loops=4)

56. 0.149 30.960 ↑ 261.5 6 4

Hash Left Join (cost=527.10..22,185.62 rows=1,569 width=2,040) (actual time=12.227..30.960 rows=6 loops=4)

  • Hash Cond: (o_2.order_status_code = order_status_2.code)
57. 24.897 30.552 ↑ 261.5 6 4

Parallel Bitmap Heap Scan on "order" o_2 (cost=523.60..22,176.04 rows=1,569 width=1,004) (actual time=11.829..30.552 rows=6 loops=4)

  • Recheck Cond: ((payer_contragent_code)::text = '56090b33d83467dd84bd15ce'::text)
  • Filter: ((NOT deleted) AND (date_time_create >= '2019-08-07 00:00:00'::timestamp without time zone) AND (date_time_create <= '2019-09-07 23:59:59'::timestamp without time zone))
  • Rows Removed by Filter: 5559
  • Heap Blocks: exact=6014
58. 5.655 5.655 ↓ 1.1 22,259 1

Bitmap Index Scan on idx_order_payer_code (cost=0.00..522.39 rows=19,710 width=0) (actual time=5.655..5.655 rows=22,259 loops=1)

  • Index Cond: ((payer_contragent_code)::text = '56090b33d83467dd84bd15ce'::text)
59. 0.033 0.259 ↓ 26.0 26 4

Hash (cost=3.49..3.49 rows=1 width=1,040) (actual time=0.259..0.259 rows=26 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
60. 0.146 0.226 ↓ 26.0 26 4

Nested Loop Left Join (cost=0.14..3.49 rows=1 width=1,040) (actual time=0.102..0.226 rows=26 loops=4)

  • Join Filter: (order_status_2."groupCode" = order_status_group_2.code)
  • Rows Removed by Join Filter: 29
61. 0.077 0.077 ↓ 26.0 26 4

Index Scan using "idx-order_status-lang" on order_status order_status_2 (cost=0.14..2.36 rows=1 width=524) (actual time=0.066..0.077 rows=26 loops=4)

  • Index Cond: ((lang)::text = 'rus'::text)
62. 0.003 0.003 ↓ 2.0 2 104

Seq Scan on order_status_group order_status_group_2 (cost=0.00..1.11 rows=1 width=520) (actual time=0.002..0.003 rows=2 loops=104)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 3
63. 0.002 0.002 ↓ 0.0 0 23

Index Scan using "idx-order_id_ek5" on "order" ro_2 (cost=0.56..2.76 rows=1 width=26) (actual time=0.002..0.002 rows=0 loops=23)

  • Index Cond: (o_2.reverse_ek5_id = id_ek5)
64. 0.001 0.001 ↓ 0.0 0 23

Index Scan using "idx-order_id_ek5" on "order" so_2 (cost=0.56..2.76 rows=1 width=26) (actual time=0.001..0.001 rows=0 loops=23)

  • Index Cond: (o_2.straight_ek5_id = id_ek5)
65. 0.112 0.309 ↑ 1.0 282 4

Hash (cost=23.19..23.19 rows=282 width=41) (actual time=0.309..0.309 rows=282 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
66. 0.147 0.197 ↑ 1.0 282 4

Bitmap Heap Scan on tariff_type tariff_type_2 (cost=4.66..23.19 rows=282 width=41) (actual time=0.061..0.197 rows=282 loops=4)

  • Recheck Cond: ((lang)::text = 'rus'::text)
  • Heap Blocks: exact=15
67. 0.050 0.050 ↑ 1.0 282 4

Bitmap Index Scan on "idx-tariff_type-lang" (cost=0.00..4.59 rows=282 width=0) (actual time=0.050..0.050 rows=282 loops=4)

  • Index Cond: ((lang)::text = 'rus'::text)
68. 0.016 0.054 ↓ 27.0 27 4

Hash (cost=2.36..2.36 rows=1 width=520) (actual time=0.054..0.054 rows=27 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
69. 0.038 0.038 ↓ 27.0 27 4

Index Scan using "idx-delivery_detail_additional_status-lang" on delivery_detail_additional_status delivery_detail_additional_status_2 (cost=0.14..2.36 rows=1 width=520) (actual time=0.025..0.038 rows=27 loops=4)

  • Index Cond: ((lang)::text = 'rus'::text)
70. 0.007 0.007 ↑ 1.0 1 23

Index Scan using "idx-city-code-lang" on city rc_2 (cost=0.43..1.90 rows=1 width=29) (actual time=0.007..0.007 rows=1 loops=23)

  • Index Cond: ((code = (((o_2.receiver)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
71. 0.005 0.005 ↑ 1.0 1 23

Index Scan using "idx-city-code-lang" on city sc_2 (cost=0.43..1.90 rows=1 width=29) (actual time=0.005..0.005 rows=1 loops=23)

  • Index Cond: ((code = (((o_2.sender)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
Planning time : 20.757 ms
Execution time : 89.553 ms