explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uQwY

Settings
# exclusive inclusive rows x rows loops node
1. 81.987 27,736.378 ↑ 101.1 75,758 1

Unique (cost=17,293,163.12..18,269,942.28 rows=7,661,013 width=577) (actual time=27,603.883..27,736.378 rows=75,758 loops=1)

2. 276.986 27,654.391 ↑ 101.1 75,758 1

Sort (cost=17,293,163.12..17,312,315.65 rows=7,661,013 width=577) (actual time=27,603.880..27,654.391 rows=75,758 loops=1)

  • Sort Key: emp_employee.nr, emp_work_agreement.nr, dty_duty_line.duty_date, dty_duty_line_period.start_date, (CASE WHEN (dty_duty_line_period.duty_line_id IS NULL) THEN 0::bigint ELSE row_number() OVER (?) END), (date_part('week'::text, dty_duty_line.duty_date)), aux_period.p_period, aux_duty.code, dty_duty_line_period.end_date, (CASE WHEN ((dty_duty_line.flags & 128) = 128) THEN aux_duty_type_dyn_nominal.code ELSE aux_duty_type_dyn.code END), (CASE WHEN ((dty_duty_line.flags & 128) = 128) THEN dty_duty_line.hours_nominal ELSE dty_duty_line_period.hours END), customer_br.name, customer_br.code, (COALESCE(fin_customer_br.name, customer_br.name)), (COALESCE(fin_customer_br.code, customer_br.code)), emp_employee.name_compound, emp_br.name, emp_br.code, (COALESCE(fin_emp_br.name, emp_br.name)), (COALESCE(fin_emp_br.code, emp_br.code)), emp_ben_function.description, emp_ben_function.code, (CASE WHEN ((dty_duty_line.flags & 1) = 1) THEN 1 ELSE 0 END), (CASE WHEN (dty_duty_line.credit_duty_line_id IS NOT NULL) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 128) = 128) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 16) = 16) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 8) = 8) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 2097152) = 2097152) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 256) = 256) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 1048576) = 1048576) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 524288) = 524288) THEN 1 ELSE 0 END), (CASE WHEN ((dty_duty_line.flags & 262144) = 262144) THEN 1 ELSE 0 END), dty_duty_line.status_svc, dty_duty_line.calculation_date, dty_duty_line.calculation_error, (CASE WHEN ((dty_duty_line.fin_emp_km <> 0::double precision) AND (row_number() OVER (?) = 1)) THEN dty_duty_line.fin_emp_km ELSE NULL::real END), (CASE WHEN ((dty_duty_line.fin_emp_km_manual <> 0::double precision) AND (row_number() OVER (?) = 1)) THEN dty_duty_line.fin_emp_km_manual ELSE NULL::real END), dty_duty_line.fin_emp_travel_expenses_counter, (round((((COALESCE(jrn.amount_4400, 0::numeric))::double precision * COALESCE(jrn.perc, 0::real)))::numeric, 2)), (round((((COALESCE(jrn.amount_4010, 0::numeric))::double precision * COALESCE(jrn.perc, 0::real)))::numeric, 2)), (round((((COALESCE(jrn.amount_4100, 0::numeric))::double precision * COALESCE(jrn.perc, 0::real)))::numeric, 2)), (round((((COALESCE(jrn.amount_4110, 0::numeric))::double precision * COALESCE(jrn.perc, 0::real)))::numeric, 2)), (round((((COALESCE(jrn.amount_4200, 0::numeric))::double precision * COALESCE(jrn.perc, 0::real)))::numeric, 2)), (round((((COALESCE(jrn.amount_4300, 0::numeric))::double precision * COALESCE(jrn.perc, 0::real)))::numeric, 2)), (round((((COALESCE(jrn.amount_4900, 0::numeric))::double precision * COALESCE(jrn.perc, 0::real)))::numeric, 2)), dty_duty_line.duty_line_id, customer_br.br_id, emp_employee.emp_id, emp_br.br_id, emp_ben_function.function_id
  • Sort Method: external merge Disk: 28664kB
3. 614.166 27,377.405 ↑ 101.1 75,758 1

WindowAgg (cost=9,202,040.50..10,446,955.12 rows=7,661,013 width=577) (actual time=26,704.844..27,377.405 rows=75,758 loops=1)

4. 247.047 26,763.239 ↑ 101.1 75,758 1

Sort (cost=9,202,040.50..9,221,193.04 rows=7,661,013 width=577) (actual time=26,704.735..26,763.239 rows=75,758 loops=1)

  • Sort Key: dty_duty_line_period.duty_line_id, dty_duty_line_period.start_date
  • Sort Method: external merge Disk: 18600kB
5. 84.173 26,516.192 ↑ 101.1 75,758 1

Hash Left Join (cost=128,199.12..2,355,832.50 rows=7,661,013 width=577) (actual time=318.549..26,516.192 rows=75,758 loops=1)

  • Hash Cond: (dty_duty_line.customer_br_id = acc_br.access_code)
  • Filter: ((acc_all.account_id IS NOT NULL) OR (acc_br.account_id IS NOT NULL))
6. 112.081 26,423.674 ↑ 101.1 75,758 1

Nested Loop Left Join (cost=128,112.46..2,326,973.96 rows=7,661,205 width=593) (actual time=310.179..26,423.674 rows=75,758 loops=1)

7. 13,845.330 26,311.593 ↑ 101.1 75,758 1

Nested Loop Left Join (cost=128,027.74..2,231,124.16 rows=7,661,205 width=585) (actual time=309.768..26,311.593 rows=75,758 loops=1)

  • Join Filter: ((aux_period.valid_from <= dty_duty_line.duty_date) AND (aux_period.valid_to > dty_duty_line.duty_date))
  • Rows Removed by Join Filter: 55303340
8. 55.645 2,087.417 ↑ 1.2 75,758 1

Hash Left Join (cost=128,027.74..1,024,460.32 rows=94,324 width=581) (actual time=309.249..2,087.417 rows=75,758 loops=1)

  • Hash Cond: (dty_duty_line_period.duty_line_period_id = jrn.dtp_id)
9. 57.785 1,942.501 ↑ 1.2 75,758 1

Hash Left Join (cost=14,547.84..910,626.71 rows=94,324 width=361) (actual time=219.964..1,942.501 rows=75,758 loops=1)

  • Hash Cond: (customer_br.fin_br_dyn_id = fin_customer_br.br_dyn_id)
  • Join Filter: ((fin_customer_br.valid_from <= dty_duty_line.duty_date) AND (fin_customer_br.valid_to > dty_duty_line.duty_date))
10. 71.570 1,880.750 ↑ 1.2 75,758 1

Hash Left Join (cost=14,327.35..909,565.17 rows=94,324 width=338) (actual time=215.985..1,880.750 rows=75,758 loops=1)

  • Hash Cond: (emp_benefit.function_id = emp_ben_function.function_id)
11. 59.901 1,808.058 ↑ 1.2 75,758 1

Hash Left Join (cost=14,268.78..908,091.74 rows=94,324 width=309) (actual time=214.842..1,808.058 rows=75,758 loops=1)

  • Hash Cond: (emp_br.fin_br_dyn_id = fin_emp_br.br_dyn_id)
  • Join Filter: ((fin_emp_br.valid_from <= dty_duty_line.duty_date) AND (fin_emp_br.valid_to > dty_duty_line.duty_date))
12. 131.402 1,744.199 ↑ 1.2 75,758 1

Hash Left Join (cost=14,048.29..907,030.21 rows=94,324 width=286) (actual time=210.869..1,744.199 rows=75,758 loops=1)

  • Hash Cond: (emp_benefit.br_id = emp_br.br_id)
  • Join Filter: ((emp_br.valid_from <= dty_duty_line.duty_date) AND (emp_br.valid_to > dty_duty_line.duty_date))
  • Rows Removed by Join Filter: 69392
13. 164.207 1,608.637 ↑ 1.2 75,758 1

Hash Left Join (cost=13,827.79..901,380.21 rows=94,324 width=247) (actual time=206.687..1,608.637 rows=75,758 loops=1)

  • Hash Cond: ((dty_duty_line.emp_id = emp_work_agreement.emp_id) AND (dty_duty_line.wa_id = emp_work_agreement.wa_id))
14. 71.564 1,420.483 ↑ 1.2 75,758 1

Hash Left Join (cost=12,502.22..897,460.69 rows=94,324 width=259) (actual time=182.702..1,420.483 rows=75,758 loops=1)

  • Hash Cond: (dty_duty_line_period.duty_type_id = aux_duty_type_dyn.duty_type_id)
  • Join Filter: ((aux_duty_type_dyn.valid_from <= dty_duty_line.duty_date) AND (aux_duty_type_dyn.valid_to > dty_duty_line.duty_date))
15. 104.095 1,348.871 ↑ 1.2 75,758 1

Nested Loop Left Join (cost=12,497.89..895,687.78 rows=94,324 width=263) (actual time=182.632..1,348.871 rows=75,758 loops=1)

16. 125.161 903.166 ↑ 1.3 56,935 1

Hash Left Join (cost=12,497.46..109,842.50 rows=75,560 width=219) (actual time=182.610..903.166 rows=56,935 loops=1)

  • Hash Cond: (dty_duty_line.emp_id = emp_employee.emp_id)
17. 110.248 747.343 ↑ 1.3 56,935 1

Hash Left Join (cost=10,188.53..105,927.92 rows=75,560 width=185) (actual time=151.901..747.343 rows=56,935 loops=1)

  • Hash Cond: (dty_duty_line.customer_br_id = customer_br.br_id)
  • Join Filter: ((customer_br.valid_from <= dty_duty_line.duty_date) AND (customer_br.valid_to > dty_duty_line.duty_date))
  • Rows Removed by Join Filter: 57947
18. 297.318 632.882 ↑ 1.3 56,935 1

Hash Left Join (cost=9,968.03..101,346.85 rows=75,560 width=138) (actual time=147.661..632.882 rows=56,935 loops=1)

  • Hash Cond: ((dty_duty_line.emp_id = emp_benefit.emp_id) AND (dty_duty_line.wa_id = emp_benefit.wa_id))
  • Join Filter: ((emp_benefit.valid_from <= dty_duty_line.duty_date) AND (emp_benefit.valid_to > dty_duty_line.duty_date))
  • Rows Removed by Join Filter: 390621
19. 31.347 191.835 ↑ 1.3 56,935 1

Hash Left Join (cost=212.43..79,323.17 rows=75,560 width=122) (actual time=3.860..191.835 rows=56,935 loops=1)

  • Hash Cond: (dty_duty_line.nominal_duty_type_id = aux_duty_type_dyn_nominal.duty_type_id)
  • Join Filter: ((aux_duty_type_dyn_nominal.valid_from <= dty_duty_line.duty_date) AND (aux_duty_type_dyn_nominal.valid_to > dty_duty_line.duty_date))
20. 79.267 160.435 ↑ 1.3 56,935 1

Hash Left Join (cost=208.10..79,027.83 rows=75,560 width=126) (actual time=3.801..160.435 rows=56,935 loops=1)

  • Hash Cond: (dty_duty_line.planned_duty_id = aux_duty.duty_id)
21. 77.393 77.393 ↑ 1.3 56,935 1

Index Scan using dty_duty_line_7e9553 on dty_duty_line (cost=0.43..77,553.55 rows=75,560 width=130) (actual time=0.013..77.393 rows=56,935 loops=1)

  • Index Cond: ((duty_date >= '2019-01-01 00:00:00+01'::timestamp with time zone) AND (duty_date < '2019-02-01 00:00:00+01'::timestamp with time zone))
22. 1.873 3.775 ↑ 1.0 5,763 1

Hash (cost=135.63..135.63 rows=5,763 width=12) (actual time=3.775..3.775 rows=5,763 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 271kB
23. 1.902 1.902 ↑ 1.0 5,763 1

Seq Scan on aux_duty (cost=0.00..135.63 rows=5,763 width=12) (actual time=0.005..1.902 rows=5,763 loops=1)

24. 0.027 0.053 ↑ 1.0 59 1

Hash (cost=3.59..3.59 rows=59 width=28) (actual time=0.053..0.053 rows=59 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
25. 0.026 0.026 ↑ 1.0 59 1

Seq Scan on aux_duty_type_dyn aux_duty_type_dyn_nominal (cost=0.00..3.59 rows=59 width=28) (actual time=0.004..0.026 rows=59 loops=1)

26. 65.651 143.729 ↓ 1.0 153,337 1

Hash (cost=6,126.06..6,126.06 rows=152,570 width=48) (actual time=143.729..143.729 rows=153,337 loops=1)

  • Buckets: 8192 Batches: 4 Memory Usage: 3015kB
27. 78.078 78.078 ↓ 1.0 153,337 1

Seq Scan on emp_benefit (cost=0.00..6,126.06 rows=152,570 width=48) (actual time=0.008..78.078 rows=153,337 loops=1)

  • Filter: ((flags & 4) <> 4)
28. 2.208 4.213 ↑ 1.0 5,133 1

Hash (cost=156.33..156.33 rows=5,133 width=63) (actual time=4.213..4.213 rows=5,133 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 457kB
29. 2.005 2.005 ↑ 1.0 5,133 1

Seq Scan on br_dyn customer_br (cost=0.00..156.33 rows=5,133 width=63) (actual time=0.006..2.005 rows=5,133 loops=1)

30. 10.555 30.662 ↑ 1.0 27,108 1

Hash (cost=1,970.08..1,970.08 rows=27,108 width=34) (actual time=30.662..30.662 rows=27,108 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 1857kB
31. 20.107 20.107 ↑ 1.0 27,108 1

Seq Scan on emp_employee (cost=0.00..1,970.08 rows=27,108 width=34) (actual time=0.006..20.107 rows=27,108 loops=1)

32. 341.610 341.610 ↑ 4.0 1 56,935

Index Scan using dty_duty_line_period_duty_line_id_idx on dty_duty_line_period (cost=0.43..10.36 rows=4 width=44) (actual time=0.005..0.006 rows=1 loops=56,935)

  • Index Cond: (duty_line_id = dty_duty_line.duty_line_id)
33. 0.020 0.048 ↑ 1.0 59 1

Hash (cost=3.59..3.59 rows=59 width=28) (actual time=0.048..0.048 rows=59 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
34. 0.028 0.028 ↑ 1.0 59 1

Seq Scan on aux_duty_type_dyn (cost=0.00..3.59 rows=59 width=28) (actual time=0.005..0.028 rows=59 loops=1)

35. 12.178 23.947 ↑ 1.0 35,663 1

Hash (cost=790.63..790.63 rows=35,663 width=20) (actual time=23.947..23.947 rows=35,663 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 1951kB
36. 11.769 11.769 ↑ 1.0 35,663 1

Seq Scan on emp_work_agreement (cost=0.00..790.63 rows=35,663 width=20) (actual time=0.006..11.769 rows=35,663 loops=1)

37. 2.176 4.160 ↑ 1.0 5,133 1

Hash (cost=156.33..156.33 rows=5,133 width=63) (actual time=4.160..4.160 rows=5,133 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 457kB
38. 1.984 1.984 ↑ 1.0 5,133 1

Seq Scan on br_dyn emp_br (cost=0.00..156.33 rows=5,133 width=63) (actual time=0.005..1.984 rows=5,133 loops=1)

39. 2.094 3.958 ↑ 1.0 5,133 1

Hash (cost=156.33..156.33 rows=5,133 width=55) (actual time=3.958..3.958 rows=5,133 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 457kB
40. 1.864 1.864 ↑ 1.0 5,133 1

Seq Scan on br_dyn fin_emp_br (cost=0.00..156.33 rows=5,133 width=55) (actual time=0.004..1.864 rows=5,133 loops=1)

41. 0.618 1.122 ↑ 1.0 1,581 1

Hash (cost=38.81..38.81 rows=1,581 width=37) (actual time=1.122..1.122 rows=1,581 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 114kB
42. 0.504 0.504 ↑ 1.0 1,581 1

Seq Scan on aux_function emp_ben_function (cost=0.00..38.81 rows=1,581 width=37) (actual time=0.006..0.504 rows=1,581 loops=1)

43. 2.132 3.966 ↑ 1.0 5,133 1

Hash (cost=156.33..156.33 rows=5,133 width=55) (actual time=3.966..3.966 rows=5,133 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 457kB
44. 1.834 1.834 ↑ 1.0 5,133 1

Seq Scan on br_dyn fin_customer_br (cost=0.00..156.33 rows=5,133 width=55) (actual time=0.003..1.834 rows=5,133 loops=1)

45. 0.038 89.271 ↓ 1.7 76 1

Hash (cost=113,479.34..113,479.34 rows=44 width=236) (actual time=89.271..89.271 rows=76 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 7kB
46. 0.044 89.233 ↓ 1.7 76 1

Subquery Scan on jrn (cost=113,477.69..113,479.34 rows=44 width=236) (actual time=89.086..89.233 rows=76 loops=1)

47. 0.123 89.189 ↓ 1.7 76 1

WindowAgg (cost=113,477.69..113,478.90 rows=44 width=38) (actual time=89.085..89.189 rows=76 loops=1)

48. 0.061 89.066 ↓ 1.7 76 1

Sort (cost=113,477.69..113,477.80 rows=44 width=38) (actual time=89.056..89.066 rows=76 loops=1)

  • Sort Key: jrn_journal.duty_line_id
  • Sort Method: quicksort Memory: 35kB
49. 0.494 89.005 ↓ 1.7 76 1

HashAggregate (cost=113,474.95..113,476.49 rows=44 width=38) (actual time=88.950..89.005 rows=76 loops=1)

  • Group Key: jrn_journal.duty_line_id, dty_duty_line_period_1.duty_line_period_id
50. 0.106 88.511 ↓ 4.6 204 1

Nested Loop (cost=78,672.51..113,472.97 rows=44 width=38) (actual time=86.990..88.511 rows=204 loops=1)

51. 0.003 0.109 ↑ 1.0 1 1

Unique (cost=4.74..43.00 rows=1 width=24) (actual time=0.086..0.109 rows=1 loops=1)

52. 0.024 0.106 ↓ 2.0 2 1

Nested Loop (cost=4.74..43.00 rows=1 width=24) (actual time=0.085..0.106 rows=2 loops=1)

53. 0.024 0.024 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog (cost=0.00..2.17 rows=1 width=32) (actual time=0.020..0.024 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'ADMIN_SALARY'::text))
  • Rows Removed by Filter: 77
54. 0.009 0.058 ↑ 1.5 2 1

Nested Loop (cost=4.74..40.80 rows=3 width=8) (actual time=0.042..0.058 rows=2 loops=1)

55. 0.023 0.033 ↓ 1.3 4 1

Bitmap Heap Scan on acc_account_group (cost=4.45..15.83 rows=3 width=8) (actual time=0.030..0.033 rows=4 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
56. 0.010 0.010 ↓ 1.3 4 1

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (actual time=0.010..0.010 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
57. 0.016 0.016 ↓ 0.0 0 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant (cost=0.29..8.31 rows=1 width=16) (actual time=0.003..0.004 rows=0 loops=4)

  • Index Cond: ((group_id = acc_account_group.group_id) AND (grant_catalog_id = acc_grant_catalog.grant_catalog_id))
  • Filter: (NOT disable)
58. 0.094 88.296 ↓ 4.6 204 1

Nested Loop (cost=78,667.78..113,429.52 rows=44 width=38) (actual time=86.899..88.296 rows=204 loops=1)

59. 0.002 0.067 ↑ 1.0 1 1

Unique (cost=4.74..43.00 rows=1 width=24) (actual time=0.038..0.067 rows=1 loops=1)

60. 0.009 0.065 ↑ 1.0 1 1

Nested Loop (cost=4.74..43.00 rows=1 width=24) (actual time=0.037..0.065 rows=1 loops=1)

61. 0.018 0.018 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog acc_grant_catalog_1 (cost=0.00..2.17 rows=1 width=32) (actual time=0.008..0.018 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
  • Rows Removed by Filter: 77
62. 0.008 0.038 ↑ 3.0 1 1

Nested Loop (cost=4.74..40.80 rows=3 width=8) (actual time=0.022..0.038 rows=1 loops=1)

63. 0.012 0.014 ↓ 1.3 4 1

Bitmap Heap Scan on acc_account_group acc_account_group_1 (cost=4.45..15.83 rows=3 width=8) (actual time=0.010..0.014 rows=4 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
64. 0.002 0.002 ↓ 1.3 4 1

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (actual time=0.002..0.002 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
65. 0.016 0.016 ↓ 0.0 0 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_1 (cost=0.29..8.31 rows=1 width=16) (actual time=0.004..0.004 rows=0 loops=4)

  • Index Cond: ((group_id = acc_account_group_1.group_id) AND (grant_catalog_id = acc_grant_catalog_1.grant_catalog_id))
  • Filter: (NOT disable)
66. 0.162 88.135 ↓ 4.6 204 1

Hash Left Join (cost=78,663.04..113,386.07 rows=44 width=38) (actual time=86.857..88.135 rows=204 loops=1)

  • Hash Cond: (jrn_journal.br_id = acc_br_1.access_code)
  • Filter: ((acc_all_1.account_id IS NOT NULL) OR (acc_br_1.account_id IS NOT NULL))
67. 0.083 79.576 ↓ 4.6 204 1

Nested Loop Left Join (cost=78,576.37..113,299.23 rows=44 width=54) (actual time=78.435..79.576 rows=204 loops=1)

68. 0.229 78.881 ↓ 4.6 204 1

Nested Loop (cost=78,491.65..113,213.93 rows=44 width=46) (actual time=77.987..78.881 rows=204 loops=1)

  • Join Filter: (jrn_journal.duty_line_id = dty_duty_line_period_1.duty_line_id)
69. 0.248 78.304 ↑ 1.4 116 1

Hash Join (cost=78,491.22..111,420.28 rows=157 width=34) (actual time=77.963..78.304 rows=116 loops=1)

  • Hash Cond: (jrn_journal.duty_line_id = dty_duty_line_1.duty_line_id)
70. 0.178 0.178 ↑ 218.3 116 1

Index Scan using jrn_journal_delivery_date on jrn_journal (cost=0.44..32,579.74 rows=25,323 width=26) (actual time=0.021..0.178 rows=116 loops=1)

  • Index Cond: ((delivery_date >= '2019-01-01 00:00:00+01'::timestamp with time zone) AND (delivery_date <= '2019-02-01 00:00:00+01'::timestamp with time zone))
  • Filter: (account_nr = ANY ('{4400,4010,4100,4110,4200,4300,4900}'::integer[]))
  • Rows Removed by Filter: 116
71. 20.343 77.878 ↑ 1.3 58,094 1

Hash (cost=77,546.28..77,546.28 rows=75,560 width=8) (actual time=77.878..77.878 rows=58,094 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2270kB
72. 57.535 57.535 ↑ 1.3 58,094 1

Index Scan using dty_duty_line_7e9553 on dty_duty_line dty_duty_line_1 (cost=0.43..77,546.28 rows=75,560 width=8) (actual time=0.010..57.535 rows=58,094 loops=1)

  • Index Cond: ((duty_date >= '2019-01-01 00:00:00+01'::timestamp with time zone) AND (duty_date <= '2019-02-01 00:00:00+01'::timestamp with time zone))
73. 0.348 0.348 ↓ 2.0 2 116

Index Scan using dty_duty_line_period_duty_line_id_idx on dty_duty_line_period dty_duty_line_period_1 (cost=0.43..11.41 rows=1 width=20) (actual time=0.003..0.003 rows=2 loops=116)

  • Index Cond: (duty_line_id = dty_duty_line_1.duty_line_id)
  • Filter: (COALESCE(dcc_id, 0::bigint) = ANY ('{1,2,3,4,8,11,12,13,14,15,30,31,32,33}'::bigint[]))
74. 0.170 0.612 ↑ 1.0 1 204

Materialize (cost=84.72..84.74 rows=1 width=8) (actual time=0.002..0.003 rows=1 loops=204)

75. 0.002 0.442 ↑ 1.0 1 1

Subquery Scan on acc_all_1 (cost=84.72..84.74 rows=1 width=8) (actual time=0.441..0.442 rows=1 loops=1)

76. 0.009 0.440 ↑ 1.0 1 1

HashAggregate (cost=84.72..84.73 rows=1 width=32) (actual time=0.440..0.440 rows=1 loops=1)

  • Group Key: acc_account_group_2.account_id, acc_grant_2.access_code
77. 0.066 0.431 ↓ 3.0 3 1

Nested Loop (cost=5.59..84.71 rows=1 width=32) (actual time=0.256..0.431 rows=3 loops=1)

78. 0.042 0.285 ↓ 80.0 80 1

Nested Loop (cost=5.45..84.51 rows=1 width=40) (actual time=0.085..0.285 rows=80 loops=1)

79. 0.007 0.107 ↓ 1.3 4 1

Nested Loop (cost=5.16..59.46 rows=3 width=32) (actual time=0.077..0.107 rows=4 loops=1)

80. 0.028 0.028 ↓ 1.3 4 1

Index Scan using acc_account_group_idx on acc_account_group acc_account_group_2 (cost=0.42..16.41 rows=3 width=32) (actual time=0.027..0.028 rows=4 loops=1)

  • Index Cond: ((account_id IS NOT NULL) AND (account_id = (current_setting('aysist.uid'::text))::bigint))
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
81. 0.003 0.072 ↑ 1.0 1 4

Materialize (cost=4.74..43.02 rows=1 width=0) (actual time=0.012..0.018 rows=1 loops=4)

82. 0.002 0.069 ↑ 1.0 1 1

Subquery Scan on acc_grant_emp (cost=4.74..43.01 rows=1 width=0) (actual time=0.047..0.069 rows=1 loops=1)

83. 0.002 0.067 ↑ 1.0 1 1

Unique (cost=4.74..43.00 rows=1 width=24) (actual time=0.046..0.067 rows=1 loops=1)

84. 0.012 0.065 ↑ 1.0 1 1

Nested Loop (cost=4.74..43.00 rows=1 width=24) (actual time=0.044..0.065 rows=1 loops=1)

85. 0.021 0.021 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog acc_grant_catalog_3 (cost=0.00..2.17 rows=1 width=32) (actual time=0.011..0.021 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
  • Rows Removed by Filter: 77
86. 0.006 0.032 ↑ 3.0 1 1

Nested Loop (cost=4.74..40.80 rows=3 width=8) (actual time=0.021..0.032 rows=1 loops=1)

87. 0.011 0.014 ↓ 1.3 4 1

Bitmap Heap Scan on acc_account_group acc_account_group_3 (cost=4.45..15.83 rows=3 width=8) (actual time=0.012..0.014 rows=4 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
88. 0.003 0.003 ↓ 1.3 4 1

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (actual time=0.003..0.003 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
89. 0.012 0.012 ↓ 0.0 0 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_3 (cost=0.29..8.31 rows=1 width=16) (actual time=0.003..0.003 rows=0 loops=4)

  • Index Cond: ((group_id = acc_account_group_3.group_id) AND (grant_catalog_id = acc_grant_catalog_3.grant_catalog_id))
  • Filter: (NOT disable)
90. 0.136 0.136 ↓ 20.0 20 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_2 (cost=0.29..8.34 rows=1 width=24) (actual time=0.025..0.034 rows=20 loops=4)

  • Index Cond: ((group_id = acc_account_group_2.group_id) AND (access_code IS NULL))
  • Filter: (NOT disable)
91. 0.080 0.080 ↓ 0.0 0 80

Index Scan using pk_acc_grant_catalog on acc_grant_catalog acc_grant_catalog_2 (cost=0.14..0.19 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=80)

  • Index Cond: (grant_catalog_id = acc_grant_2.grant_catalog_id)
  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
  • Rows Removed by Filter: 1
92. 0.937 8.397 ↓ 2,849.0 2,849 1

Hash (cost=86.65..86.65 rows=1 width=16) (actual time=8.397..8.397 rows=2,849 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 134kB
93. 1.130 7.460 ↓ 2,850.0 2,850 1

Subquery Scan on acc_br_1 (cost=86.63..86.65 rows=1 width=16) (actual time=5.504..7.460 rows=2,850 loops=1)

94. 2.313 6.330 ↓ 2,850.0 2,850 1

HashAggregate (cost=86.63..86.64 rows=1 width=32) (actual time=5.503..6.330 rows=2,850 loops=1)

  • Group Key: acc_account_group_4.account_id, acc_grant_4.access_code
95. 1.191 4.017 ↓ 2,852.0 2,852 1

Nested Loop (cost=5.45..86.62 rows=1 width=32) (actual time=0.095..4.017 rows=2,852 loops=1)

96. 0.015 0.015 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog acc_grant_catalog_4 (cost=0.00..2.17 rows=1 width=8) (actual time=0.008..0.015 rows=1 loops=1)

  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
  • Rows Removed by Filter: 77
97. 1.222 2.811 ↓ 950.7 2,852 1

Nested Loop (cost=5.45..84.42 rows=3 width=40) (actual time=0.079..2.811 rows=2,852 loops=1)

98. 0.005 0.077 ↓ 1.3 4 1

Nested Loop (cost=5.16..59.46 rows=3 width=32) (actual time=0.051..0.077 rows=4 loops=1)

99. 0.012 0.012 ↓ 1.3 4 1

Index Scan using acc_account_group_idx on acc_account_group acc_account_group_4 (cost=0.42..16.40 rows=3 width=32) (actual time=0.008..0.012 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
100. 0.002 0.060 ↑ 1.0 1 4

Materialize (cost=4.74..43.02 rows=1 width=0) (actual time=0.010..0.015 rows=1 loops=4)

101. 0.003 0.058 ↑ 1.0 1 1

Subquery Scan on acc_grant_emp_1 (cost=4.74..43.01 rows=1 width=0) (actual time=0.039..0.058 rows=1 loops=1)

102. 0.002 0.055 ↑ 1.0 1 1

Unique (cost=4.74..43.00 rows=1 width=24) (actual time=0.037..0.055 rows=1 loops=1)

103. 0.009 0.053 ↑ 1.0 1 1

Nested Loop (cost=4.74..43.00 rows=1 width=24) (actual time=0.035..0.053 rows=1 loops=1)

104. 0.016 0.016 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog acc_grant_catalog_5 (cost=0.00..2.17 rows=1 width=32) (actual time=0.008..0.016 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
  • Rows Removed by Filter: 77
105. 0.005 0.028 ↑ 3.0 1 1

Nested Loop (cost=4.74..40.80 rows=3 width=8) (actual time=0.020..0.028 rows=1 loops=1)

106. 0.013 0.015 ↓ 1.3 4 1

Bitmap Heap Scan on acc_account_group acc_account_group_5 (cost=4.45..15.83 rows=3 width=8) (actual time=0.014..0.015 rows=4 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
107. 0.002 0.002 ↓ 1.3 4 1

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (actual time=0.002..0.002 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
108. 0.008 0.008 ↓ 0.0 0 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_5 (cost=0.29..8.31 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=4)

  • Index Cond: ((group_id = acc_account_group_5.group_id) AND (grant_catalog_id = acc_grant_catalog_5.grant_catalog_id))
  • Filter: (NOT disable)
109. 1.512 1.512 ↓ 713.0 713 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_4 (cost=0.29..8.31 rows=1 width=24) (actual time=0.002..0.378 rows=713 loops=4)

  • Index Cond: ((group_id = acc_account_group_4.group_id) AND (grant_catalog_id = acc_grant_catalog_4.grant_catalog_id))
  • Filter: (NOT disable)
110. 10,378.485 10,378.846 ↑ 1.0 731 75,758

Materialize (cost=0.00..25.89 rows=731 width=20) (actual time=0.000..0.137 rows=731 loops=75,758)

111. 0.361 0.361 ↑ 1.0 731 1

Seq Scan on aux_period (cost=0.00..22.24 rows=731 width=20) (actual time=0.026..0.361 rows=731 loops=1)

  • Filter: ((period_type_svc)::text = 'w'::text)
  • Rows Removed by Filter: 168
112. 0.000 0.000 ↑ 1.0 1 75,758

Materialize (cost=84.72..84.74 rows=1 width=8) (actual time=0.000..0.000 rows=1 loops=75,758)

113. 0.002 0.409 ↑ 1.0 1 1

Subquery Scan on acc_all (cost=84.72..84.74 rows=1 width=8) (actual time=0.408..0.409 rows=1 loops=1)

114. 0.006 0.407 ↑ 1.0 1 1

HashAggregate (cost=84.72..84.73 rows=1 width=32) (actual time=0.407..0.407 rows=1 loops=1)

  • Group Key: acc_account_group_6.account_id, acc_grant_6.access_code
115. 0.069 0.401 ↓ 3.0 3 1

Nested Loop (cost=5.59..84.71 rows=1 width=32) (actual time=0.245..0.401 rows=3 loops=1)

116. 0.039 0.252 ↓ 80.0 80 1

Nested Loop (cost=5.45..84.51 rows=1 width=40) (actual time=0.071..0.252 rows=80 loops=1)

117. 0.008 0.093 ↓ 1.3 4 1

Nested Loop (cost=5.16..59.46 rows=3 width=32) (actual time=0.065..0.093 rows=4 loops=1)

118. 0.025 0.025 ↓ 1.3 4 1

Index Scan using acc_account_group_idx on acc_account_group acc_account_group_6 (cost=0.42..16.41 rows=3 width=32) (actual time=0.022..0.025 rows=4 loops=1)

  • Index Cond: ((account_id IS NOT NULL) AND (account_id = (current_setting('aysist.uid'::text))::bigint))
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
119. 0.003 0.060 ↑ 1.0 1 4

Materialize (cost=4.74..43.02 rows=1 width=0) (actual time=0.010..0.015 rows=1 loops=4)

120. 0.003 0.057 ↑ 1.0 1 1

Subquery Scan on acc_grant_emp_2 (cost=4.74..43.01 rows=1 width=0) (actual time=0.037..0.057 rows=1 loops=1)

121. 0.000 0.054 ↑ 1.0 1 1

Unique (cost=4.74..43.00 rows=1 width=24) (actual time=0.036..0.054 rows=1 loops=1)

122. 0.012 0.054 ↑ 1.0 1 1

Nested Loop (cost=4.74..43.00 rows=1 width=24) (actual time=0.036..0.054 rows=1 loops=1)

123. 0.017 0.017 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog acc_grant_catalog_7 (cost=0.00..2.17 rows=1 width=32) (actual time=0.008..0.017 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
  • Rows Removed by Filter: 77
124. 0.005 0.025 ↑ 3.0 1 1

Nested Loop (cost=4.74..40.80 rows=3 width=8) (actual time=0.016..0.025 rows=1 loops=1)

125. 0.010 0.012 ↓ 1.3 4 1

Bitmap Heap Scan on acc_account_group acc_account_group_7 (cost=4.45..15.83 rows=3 width=8) (actual time=0.010..0.012 rows=4 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
126. 0.002 0.002 ↓ 1.3 4 1

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (actual time=0.002..0.002 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
127. 0.008 0.008 ↓ 0.0 0 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_7 (cost=0.29..8.31 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=4)

  • Index Cond: ((group_id = acc_account_group_7.group_id) AND (grant_catalog_id = acc_grant_catalog_7.grant_catalog_id))
  • Filter: (NOT disable)
128. 0.120 0.120 ↓ 20.0 20 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_6 (cost=0.29..8.34 rows=1 width=24) (actual time=0.020..0.030 rows=20 loops=4)

  • Index Cond: ((group_id = acc_account_group_6.group_id) AND (access_code IS NULL))
  • Filter: (NOT disable)
129. 0.080 0.080 ↓ 0.0 0 80

Index Scan using pk_acc_grant_catalog on acc_grant_catalog acc_grant_catalog_6 (cost=0.14..0.19 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=80)

  • Index Cond: (grant_catalog_id = acc_grant_6.grant_catalog_id)
  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
  • Rows Removed by Filter: 1
130. 0.903 8.345 ↓ 2,849.0 2,849 1

Hash (cost=86.65..86.65 rows=1 width=16) (actual time=8.345..8.345 rows=2,849 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 134kB
131. 1.101 7.442 ↓ 2,850.0 2,850 1

Subquery Scan on acc_br (cost=86.63..86.65 rows=1 width=16) (actual time=5.466..7.442 rows=2,850 loops=1)

132. 2.383 6.341 ↓ 2,850.0 2,850 1

HashAggregate (cost=86.63..86.64 rows=1 width=32) (actual time=5.466..6.341 rows=2,850 loops=1)

  • Group Key: acc_account_group_8.account_id, acc_grant_8.access_code
133. 1.179 3.958 ↓ 2,852.0 2,852 1

Nested Loop (cost=5.45..86.62 rows=1 width=32) (actual time=0.086..3.958 rows=2,852 loops=1)

134. 0.014 0.014 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog acc_grant_catalog_8 (cost=0.00..2.17 rows=1 width=8) (actual time=0.007..0.014 rows=1 loops=1)

  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
  • Rows Removed by Filter: 77
135. 1.248 2.765 ↓ 950.7 2,852 1

Nested Loop (cost=5.45..84.42 rows=3 width=40) (actual time=0.070..2.765 rows=2,852 loops=1)

136. 0.004 0.069 ↓ 1.3 4 1

Nested Loop (cost=5.16..59.46 rows=3 width=32) (actual time=0.043..0.069 rows=4 loops=1)

137. 0.013 0.013 ↓ 1.3 4 1

Index Scan using acc_account_group_idx on acc_account_group acc_account_group_8 (cost=0.42..16.40 rows=3 width=32) (actual time=0.009..0.013 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
138. 0.001 0.052 ↑ 1.0 1 4

Materialize (cost=4.74..43.02 rows=1 width=0) (actual time=0.009..0.013 rows=1 loops=4)

139. 0.002 0.051 ↑ 1.0 1 1

Subquery Scan on acc_grant_emp_3 (cost=4.74..43.01 rows=1 width=0) (actual time=0.033..0.051 rows=1 loops=1)

140. 0.001 0.049 ↑ 1.0 1 1

Unique (cost=4.74..43.00 rows=1 width=24) (actual time=0.031..0.049 rows=1 loops=1)

141. 0.009 0.048 ↑ 1.0 1 1

Nested Loop (cost=4.74..43.00 rows=1 width=24) (actual time=0.031..0.048 rows=1 loops=1)

142. 0.017 0.017 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog acc_grant_catalog_9 (cost=0.00..2.17 rows=1 width=32) (actual time=0.008..0.017 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
  • Rows Removed by Filter: 77
143. 0.002 0.022 ↑ 3.0 1 1

Nested Loop (cost=4.74..40.80 rows=3 width=8) (actual time=0.014..0.022 rows=1 loops=1)

144. 0.010 0.012 ↓ 1.3 4 1

Bitmap Heap Scan on acc_account_group acc_account_group_9 (cost=4.45..15.83 rows=3 width=8) (actual time=0.009..0.012 rows=4 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
145. 0.002 0.002 ↓ 1.3 4 1

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (actual time=0.002..0.002 rows=4 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
146. 0.008 0.008 ↓ 0.0 0 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_9 (cost=0.29..8.31 rows=1 width=16) (actual time=0.002..0.002 rows=0 loops=4)

  • Index Cond: ((group_id = acc_account_group_9.group_id) AND (grant_catalog_id = acc_grant_catalog_9.grant_catalog_id))
  • Filter: (NOT disable)
147. 1.448 1.448 ↓ 713.0 713 4

Index Scan using acc_grant_unique_group_grant_catalog_access_code on acc_grant acc_grant_8 (cost=0.29..8.31 rows=1 width=24) (actual time=0.002..0.362 rows=713 loops=4)

  • Index Cond: ((group_id = acc_account_group_8.group_id) AND (grant_catalog_id = acc_grant_catalog_8.grant_catalog_id))
  • Filter: (NOT disable)