explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ClK7

Settings
# exclusive inclusive rows x rows loops node
1. 2.097 598.270 ↑ 1.0 10 1

Limit (cost=237,325.56..237,325.59 rows=10 width=6,369) (actual time=596.174..598.270 rows=10 loops=1)

  • Buffers: shared hit=100680
2. 0.057 596.173 ↑ 1,103.0 10 1

Sort (cost=237,325.56..237,353.14 rows=11,030 width=6,369) (actual time=596.172..596.173 rows=10 loops=1)

  • Sort Key: (to_char(o.date_time_create, 'DD.MM.YYYY'::text)) DESC
  • Sort Method: top-N heapsort Memory: 30kB
  • Buffers: shared hit=100680
3. 0.271 596.116 ↑ 367.7 30 1

HashAggregate (cost=236,866.61..236,976.91 rows=11,030 width=6,369) (actual time=596.029..596.116 rows=30 loops=1)

  • Group Key: (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
  • Buffers: shared hit=100680
4. 0.000 595.845 ↑ 204.3 54 1

Append (cost=1,564.61..236,259.96 rows=11,030 width=6,369) (actual time=13.796..595.845 rows=54 loops=1)

  • Buffers: shared hit=100680
5. 19.019 51.180 ↑ 244.0 23 1

Gather (cost=1,564.61..42,649.64 rows=5,613 width=1,941) (actual time=13.795..51.180 rows=23 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=21087
6. 0.554 32.161 ↑ 301.8 6 4

Nested Loop Left Join (cost=564.61..41,088.34 rows=1,811 width=1,941) (actual time=20.267..32.161 rows=6 loops=4)

  • Buffers: shared hit=21087
7. 0.370 31.602 ↑ 300.7 6 4

Nested Loop Left Join (cost=564.18..37,669.13 rows=1,804 width=2,428) (actual time=19.966..31.602 rows=6 loops=4)

  • Buffers: shared hit=20870
8. 0.027 31.220 ↑ 299.7 6 4

Hash Left Join (cost=563.74..34,292.87 rows=1,798 width=2,578) (actual time=19.766..31.220 rows=6 loops=4)

  • Hash Cond: (o.order_additional_status_code = delivery_detail_additional_status.code)
  • Buffers: shared hit=20597
9. 0.029 31.148 ↑ 299.7 6 4

Hash Left Join (cost=560.39..34,284.79 rows=1,798 width=2,062) (actual time=19.700..31.148 rows=6 loops=4)

  • Hash Cond: (o.tariff_type_code = tariff_type.code)
  • Buffers: shared hit=20589
10. 0.014 30.802 ↑ 299.7 6 4

Nested Loop Left Join (cost=528.32..34,247.93 rows=1,798 width=2,029) (actual time=19.361..30.802 rows=6 loops=4)

  • Buffers: shared hit=20529
11. 0.024 30.787 ↑ 299.7 6 4

Nested Loop Left Join (cost=527.76..29,288.53 rows=1,798 width=2,035) (actual time=19.352..30.787 rows=6 loops=4)

  • Buffers: shared hit=20529
12. 0.168 30.761 ↑ 299.7 6 4

Hash Left Join (cost=527.19..24,329.13 rows=1,798 width=2,041) (actual time=19.340..30.761 rows=6 loops=4)

  • Hash Cond: (o.order_status_code = order_status.code)
  • Buffers: shared hit=20529
13. 24.649 30.434 ↑ 299.7 6 4

Parallel Bitmap Heap Scan on "order" o (cost=523.08..24,318.04 rows=1,798 width=1,005) (actual time=19.023..30.434 rows=6 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: 5528
  • Heap Blocks: exact=7691
  • Buffers: shared hit=20291
14. 5.785 5.785 ↓ 1.0 22,134 1

Bitmap Index Scan on idx_order_sender_code (cost=0.00..521.69 rows=21,670 width=0) (actual time=5.785..5.785 rows=22,134 loops=1)

  • Index Cond: ((sender_contragent_code)::text = '56090b33d83467dd84bd15ce'::text)
  • Buffers: shared hit=229
15. 0.027 0.159 ↓ 26.0 26 4

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

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=112
16. 0.082 0.132 ↓ 26.0 26 4

Nested Loop Left Join (cost=0.00..4.10 rows=1 width=1,040) (actual time=0.050..0.132 rows=26 loops=4)

  • Join Filter: (order_status."groupCode" = order_status_group.code)
  • Rows Removed by Join Filter: 29
  • Buffers: shared hit=112
17. 0.049 0.049 ↓ 26.0 26 4

Seq Scan on order_status (cost=0.00..2.98 rows=1 width=524) (actual time=0.033..0.049 rows=26 loops=4)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 52
  • Buffers: shared hit=8
18. 0.001 0.001 ↓ 2.0 2 104

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

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 3
  • Buffers: shared hit=104
19. 0.002 0.002 ↓ 0.0 0 23

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

  • Index Cond: (o.reverse_ek5_id = id_ek5)
20. 0.001 0.001 ↓ 0.0 0 23

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

  • Index Cond: (o.straight_ek5_id = id_ek5)
21. 0.088 0.317 ↑ 1.0 278 4

Hash (cost=28.60..28.60 rows=278 width=41) (actual time=0.317..0.317 rows=278 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
  • Buffers: shared hit=60
22. 0.229 0.229 ↑ 1.0 278 4

Seq Scan on tariff_type (cost=0.00..28.60 rows=278 width=41) (actual time=0.010..0.229 rows=278 loops=4)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 810
  • Buffers: shared hit=60
23. 0.016 0.045 ↓ 27.0 27 4

Hash (cost=3.34..3.34 rows=1 width=520) (actual time=0.044..0.045 rows=27 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
  • Buffers: shared hit=8
24. 0.029 0.029 ↓ 27.0 27 4

Seq Scan on delivery_detail_additional_status (cost=0.00..3.34 rows=1 width=520) (actual time=0.010..0.029 rows=27 loops=4)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 80
  • Buffers: shared hit=8
25. 0.012 0.012 ↑ 1.0 1 23

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

  • Index Cond: ((code = (((o.receiver)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
  • Buffers: shared hit=95
26. 0.005 0.005 ↑ 1.0 1 23

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

  • Index Cond: ((code = (((o.sender)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
  • Buffers: shared hit=92
27. 0.058 496.461 ↑ 38.0 1 1

Nested Loop Left Join (cost=2.55..152,491.07 rows=38 width=1,941) (actual time=44.232..496.461 rows=1 loops=1)

  • Buffers: shared hit=58272
28. 0.075 496.394 ↑ 38.0 1 1

Nested Loop Left Join (cost=2.12..152,389.61 rows=38 width=2,428) (actual time=44.165..496.394 rows=1 loops=1)

  • Buffers: shared hit=58263
29. 0.006 496.308 ↑ 38.0 1 1

Nested Loop Left Join (cost=1.69..152,288.81 rows=38 width=2,578) (actual time=44.080..496.308 rows=1 loops=1)

  • Join Filter: (o_1.order_additional_status_code = delivery_detail_additional_status_1.code)
  • Rows Removed by Join Filter: 27
  • Buffers: shared hit=58254
30. 0.005 496.267 ↑ 38.0 1 1

Nested Loop Left Join (cost=1.69..152,284.90 rows=38 width=2,062) (actual time=44.040..496.267 rows=1 loops=1)

  • Join Filter: (o_1.tariff_type_code = tariff_type_1.code)
  • Rows Removed by Join Filter: 11
  • Buffers: shared hit=58252
31. 0.005 496.244 ↑ 38.0 1 1

Nested Loop Left Join (cost=1.69..152,097.15 rows=38 width=2,029) (actual time=44.018..496.244 rows=1 loops=1)

  • Buffers: shared hit=58251
32. 0.004 496.235 ↑ 38.0 1 1

Nested Loop Left Join (cost=1.12..151,991.51 rows=38 width=2,035) (actual time=44.011..496.235 rows=1 loops=1)

  • Buffers: shared hit=58251
33. 0.010 496.223 ↑ 38.0 1 1

Nested Loop Left Join (cost=0.56..151,885.87 rows=38 width=2,041) (actual time=43.999..496.223 rows=1 loops=1)

  • Join Filter: (o_1.order_status_code = order_status_1.code)
  • Rows Removed by Join Filter: 25
  • Buffers: shared hit=58251
34. 496.115 496.115 ↑ 38.0 1 1

Index Scan using idx_order_receiver_code_date on "order" o_1 (cost=0.56..151,881.20 rows=38 width=1,005) (actual time=43.953..496.115 rows=1 loops=1)

  • Index Cond: ((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) AND ((receiver_contragent_code)::text = '56090b33d83467dd84bd15ce'::text))
  • Filter: (NOT deleted)
  • Rows Removed by Filter: 8
  • Buffers: shared hit=58223
35. 0.017 0.098 ↓ 26.0 26 1

Materialize (cost=0.00..4.11 rows=1 width=1,040) (actual time=0.036..0.098 rows=26 loops=1)

  • Buffers: shared hit=28
36. 0.028 0.081 ↓ 26.0 26 1

Nested Loop Left Join (cost=0.00..4.10 rows=1 width=1,040) (actual time=0.025..0.081 rows=26 loops=1)

  • Join Filter: (order_status_1."groupCode" = order_status_group_1.code)
  • Rows Removed by Join Filter: 29
  • Buffers: shared hit=28
37. 0.027 0.027 ↓ 26.0 26 1

Seq Scan on order_status order_status_1 (cost=0.00..2.98 rows=1 width=524) (actual time=0.011..0.027 rows=26 loops=1)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 52
  • Buffers: shared hit=2
38. 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
  • Buffers: shared hit=26
39. 0.008 0.008 ↓ 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.007..0.008 rows=0 loops=1)

  • Index Cond: (o_1.reverse_ek5_id = id_ek5)
40. 0.004 0.004 ↓ 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.004..0.004 rows=0 loops=1)

  • Index Cond: (o_1.straight_ek5_id = id_ek5)
41. 0.006 0.018 ↑ 23.2 12 1

Materialize (cost=0.00..29.99 rows=278 width=41) (actual time=0.009..0.018 rows=12 loops=1)

  • Buffers: shared hit=1
42. 0.012 0.012 ↑ 23.2 12 1

Seq Scan on tariff_type tariff_type_1 (cost=0.00..28.60 rows=278 width=41) (actual time=0.006..0.012 rows=12 loops=1)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 34
  • Buffers: shared hit=1
43. 0.009 0.035 ↓ 27.0 27 1

Materialize (cost=0.00..3.34 rows=1 width=520) (actual time=0.009..0.035 rows=27 loops=1)

  • Buffers: shared hit=2
44. 0.026 0.026 ↓ 27.0 27 1

Seq Scan on delivery_detail_additional_status delivery_detail_additional_status_1 (cost=0.00..3.34 rows=1 width=520) (actual time=0.006..0.026 rows=27 loops=1)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 80
  • Buffers: shared hit=2
45. 0.011 0.011 ↑ 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.011..0.011 rows=1 loops=1)

  • Index Cond: ((code = (((o_1.receiver)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
  • Buffers: shared hit=4
46. 0.009 0.009 ↑ 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.009..0.009 rows=1 loops=1)

  • Index Cond: ((code = (((o_1.sender)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
  • Buffers: shared hit=4
47. 16.720 50.238 ↑ 179.3 30 1

Gather (cost=1,557.78..40,953.80 rows=5,379 width=1,941) (actual time=13.609..50.238 rows=30 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
  • Buffers: shared hit=21321
48. 0.646 33.518 ↑ 216.9 8 4

Nested Loop Left Join (cost=557.78..39,415.90 rows=1,735 width=1,941) (actual time=13.830..33.518 rows=8 loops=4)

  • Buffers: shared hit=21321
49. 0.427 32.867 ↑ 216.1 8 4

Nested Loop Left Join (cost=557.35..36,130.80 rows=1,729 width=2,428) (actual time=13.569..32.867 rows=8 loops=4)

  • Buffers: shared hit=21041
50. 0.029 32.431 ↑ 215.4 8 4

Hash Left Join (cost=556.91..32,887.36 rows=1,723 width=2,578) (actual time=13.365..32.431 rows=8 loops=4)

  • Hash Cond: (o_2.order_additional_status_code = delivery_detail_additional_status_2.code)
  • Buffers: shared hit=20715
51. 0.031 32.359 ↑ 215.4 8 4

Hash Left Join (cost=553.56..32,879.48 rows=1,723 width=2,062) (actual time=13.301..32.359 rows=8 loops=4)

  • Hash Cond: (o_2.tariff_type_code = tariff_type_2.code)
  • Buffers: shared hit=20707
52. 0.018 31.985 ↑ 215.4 8 4

Nested Loop Left Join (cost=521.49..32,842.81 rows=1,723 width=2,029) (actual time=12.935..31.985 rows=8 loops=4)

  • Buffers: shared hit=20647
53. 0.025 31.966 ↑ 215.4 8 4

Nested Loop Left Join (cost=520.93..28,088.71 rows=1,723 width=2,035) (actual time=12.926..31.966 rows=8 loops=4)

  • Buffers: shared hit=20647
54. 0.161 31.940 ↑ 215.4 8 4

Hash Left Join (cost=520.36..23,334.61 rows=1,723 width=2,041) (actual time=12.915..31.940 rows=8 loops=4)

  • Hash Cond: (o_2.order_status_code = order_status_2.code)
  • Buffers: shared hit=20647
55. 25.877 31.629 ↑ 215.4 8 4

Parallel Bitmap Heap Scan on "order" o_2 (cost=516.25..23,323.82 rows=1,723 width=1,005) (actual time=12.618..31.629 rows=8 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: 5555
  • Heap Blocks: exact=6784
  • Buffers: shared hit=20409
56. 5.752 5.752 ↓ 1.1 22,251 1

Bitmap Index Scan on idx_order_payer_code (cost=0.00..514.91 rows=20,767 width=0) (actual time=5.752..5.752 rows=22,251 loops=1)

  • Index Cond: ((payer_contragent_code)::text = '56090b33d83467dd84bd15ce'::text)
  • Buffers: shared hit=231
57. 0.028 0.150 ↓ 26.0 26 4

Hash (cost=4.10..4.10 rows=1 width=1,040) (actual time=0.149..0.150 rows=26 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
  • Buffers: shared hit=112
58. 0.078 0.122 ↓ 26.0 26 4

Nested Loop Left Join (cost=0.00..4.10 rows=1 width=1,040) (actual time=0.042..0.122 rows=26 loops=4)

  • Join Filter: (order_status_2."groupCode" = order_status_group_2.code)
  • Rows Removed by Join Filter: 29
  • Buffers: shared hit=112
59. 0.043 0.043 ↓ 26.0 26 4

Seq Scan on order_status order_status_2 (cost=0.00..2.98 rows=1 width=524) (actual time=0.026..0.043 rows=26 loops=4)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 52
  • Buffers: shared hit=8
60. 0.001 0.001 ↓ 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.001..0.001 rows=2 loops=104)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 3
  • Buffers: shared hit=104
61. 0.001 0.001 ↓ 0.0 0 30

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

  • Index Cond: (o_2.reverse_ek5_id = id_ek5)
62. 0.001 0.001 ↓ 0.0 0 30

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

  • Index Cond: (o_2.straight_ek5_id = id_ek5)
63. 0.094 0.343 ↑ 1.0 278 4

Hash (cost=28.60..28.60 rows=278 width=41) (actual time=0.343..0.343 rows=278 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 36kB
  • Buffers: shared hit=60
64. 0.249 0.249 ↑ 1.0 278 4

Seq Scan on tariff_type tariff_type_2 (cost=0.00..28.60 rows=278 width=41) (actual time=0.011..0.249 rows=278 loops=4)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 810
  • Buffers: shared hit=60
65. 0.014 0.043 ↓ 27.0 27 4

Hash (cost=3.34..3.34 rows=1 width=520) (actual time=0.043..0.043 rows=27 loops=4)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
  • Buffers: shared hit=8
66. 0.029 0.029 ↓ 27.0 27 4

Seq Scan on delivery_detail_additional_status delivery_detail_additional_status_2 (cost=0.00..3.34 rows=1 width=520) (actual time=0.010..0.029 rows=27 loops=4)

  • Filter: ((lang)::text = 'rus'::text)
  • Rows Removed by Filter: 80
  • Buffers: shared hit=8
67. 0.009 0.009 ↑ 1.0 1 30

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

  • Index Cond: ((code = (((o_2.receiver)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
  • Buffers: shared hit=123
68. 0.005 0.005 ↑ 1.0 1 30

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

  • Index Cond: ((code = (((o_2.sender)::json #>> '{address,cityCode}'::text[]))::integer) AND ((lang)::text = 'rus'::text))
  • Buffers: shared hit=120
Planning time : 22.769 ms
Execution time : 599.405 ms