explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IQJAL

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 31,720.089 ↓ 0.0 0 1

Unique (cost=3,017,609.52..3,060,885.27 rows=346,206 width=1,053) (actual time=31,720.089..31,720.089 rows=0 loops=1)

2. 0.068 31,720.089 ↓ 0.0 0 1

Sort (cost=3,017,609.52..3,018,475.03 rows=346,206 width=1,053) (actual time=31,720.089..31,720.089 rows=0 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_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: quicksort Memory: 25kB
3. 0.002 31,720.021 ↓ 0.0 0 1

WindowAgg (cost=2,609,996.89..2,666,255.36 rows=346,206 width=1,053) (actual time=31,720.021..31,720.021 rows=0 loops=1)

4. 0.008 31,720.019 ↓ 0.0 0 1

Sort (cost=2,609,996.89..2,610,862.40 rows=346,206 width=1,053) (actual time=31,720.019..31,720.019 rows=0 loops=1)

  • Sort Key: dty_duty_line_period.duty_line_id, dty_duty_line_period.start_date
  • Sort Method: quicksort Memory: 25kB
5. 103.919 31,720.011 ↓ 0.0 0 1

Hash Left Join (cost=2,187,147.07..2,258,642.74 rows=346,206 width=1,053) (actual time=31,720.011..31,720.011 rows=0 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))
  • Rows Removed by Filter: 326247
6. 318.761 31,616.014 ↑ 1.1 326,247 1

Nested Loop Left Join (cost=2,187,060.90..2,257,256.41 rows=346,215 width=1,069) (actual time=29,992.621..31,616.014 rows=326,247 loops=1)

7. 210.977 31,297.253 ↑ 1.1 326,247 1

Hash Left Join (cost=2,186,976.05..2,252,843.86 rows=346,215 width=1,061) (actual time=29,992.532..31,297.253 rows=326,247 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))
8. 226.430 31,081.816 ↑ 1.1 326,247 1

Hash Left Join (cost=2,186,736.42..2,249,520.94 rows=346,215 width=1,038) (actual time=29,988.066..31,081.816 rows=326,247 loops=1)

  • Hash Cond: (emp_benefit.function_id = emp_ben_function.function_id)
9. 207.361 30,854.215 ↑ 1.1 326,247 1

Hash Left Join (cost=2,186,677.81..2,244,269.09 rows=346,215 width=1,009) (actual time=29,986.885..30,854.215 rows=326,247 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))
10. 385.369 30,642.453 ↑ 1.1 326,247 1

Hash Left Join (cost=2,186,438.18..2,240,946.18 rows=346,215 width=986) (actual time=29,982.477..30,642.453 rows=326,247 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: 326680
11. 274.634 30,252.652 ↑ 1.1 326,247 1

Hash Right Join (cost=2,186,198.55..2,218,370.08 rows=346,215 width=947) (actual time=29,978.032..30,252.652 rows=326,247 loops=1)

  • Hash Cond: (jrn.dtp_id = dty_duty_line_period.duty_line_period_id)
12. 0.000 0.154 ↓ 0.0 0 1

Subquery Scan on jrn (cost=696,512.53..696,646.90 rows=3,583 width=236) (actual time=0.154..0.154 rows=0 loops=1)

13. 0.002 0.154 ↓ 0.0 0 1

WindowAgg (cost=696,512.53..696,611.07 rows=3,583 width=38) (actual time=0.154..0.154 rows=0 loops=1)

14. 0.010 0.152 ↓ 0.0 0 1

Sort (cost=696,512.53..696,521.49 rows=3,583 width=38) (actual time=0.152..0.152 rows=0 loops=1)

  • Sort Key: jrn_journal.duty_line_id
  • Sort Method: quicksort Memory: 25kB
15. 0.008 0.142 ↓ 0.0 0 1

HashAggregate (cost=696,175.61..696,301.01 rows=3,583 width=38) (actual time=0.142..0.142 rows=0 loops=1)

  • Group Key: jrn_journal.duty_line_id, dty_duty_line_period_1.duty_line_period_id
16. 0.002 0.134 ↓ 0.0 0 1

Nested Loop (cost=218,153.01..696,014.37 rows=3,583 width=38) (actual time=0.134..0.134 rows=0 loops=1)

17. 0.003 0.098 ↑ 1.0 1 1

Unique (cost=4.74..43.05 rows=1 width=24) (actual time=0.092..0.098 rows=1 loops=1)

18. 0.015 0.095 ↑ 1.0 1 1

Nested Loop (cost=4.74..43.05 rows=1 width=24) (actual time=0.090..0.095 rows=1 loops=1)

19. 0.020 0.020 ↑ 1.0 1 1

Seq Scan on acc_grant_catalog (cost=0.00..2.17 rows=1 width=32) (actual time=0.018..0.020 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
20. 0.005 0.060 ↑ 3.0 1 1

Nested Loop (cost=4.74..40.85 rows=3 width=8) (actual time=0.059..0.060 rows=1 loops=1)

21. 0.016 0.039 ↑ 3.0 1 1

Bitmap Heap Scan on acc_account_group (cost=4.45..15.88 rows=3 width=8) (actual time=0.039..0.039 rows=1 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
22. 0.023 0.023 ↑ 3.0 1 1

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

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
23. 0.016 0.016 ↑ 1.0 1 1

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.015..0.016 rows=1 loops=1)

  • Index Cond: ((group_id = acc_account_group.group_id) AND (grant_catalog_id = acc_grant_catalog.grant_catalog_id))
  • Filter: (NOT disable)
24. 0.000 0.034 ↓ 0.0 0 1

Nested Loop (cost=218,148.27..695,935.48 rows=3,583 width=38) (actual time=0.034..0.034 rows=0 loops=1)

25. 0.001 0.034 ↓ 0.0 0 1

Unique (cost=4.74..43.05 rows=1 width=24) (actual time=0.034..0.034 rows=0 loops=1)

26. 0.007 0.033 ↓ 0.0 0 1

Nested Loop (cost=4.74..43.05 rows=1 width=24) (actual time=0.033..0.033 rows=0 loops=1)

27. 0.013 0.013 ↑ 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.005..0.013 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
  • Rows Removed by Filter: 77
28. 0.001 0.013 ↓ 0.0 0 1

Nested Loop (cost=4.74..40.85 rows=3 width=8) (actual time=0.013..0.013 rows=0 loops=1)

29. 0.008 0.010 ↑ 3.0 1 1

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

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
30. 0.002 0.002 ↑ 3.0 1 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=1 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
31. 0.002 0.002 ↓ 0.0 0 1

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.002..0.002 rows=0 loops=1)

  • Index Cond: ((group_id = acc_account_group_1.group_id) AND (grant_catalog_id = acc_grant_catalog_1.grant_catalog_id))
  • Filter: (NOT disable)
32. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=218,143.54..695,856.59 rows=3,583 width=38) (never executed)

  • 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))
33. 0.000 0.000 ↓ 0.0 0

Nested Loop Left Join (cost=218,057.37..695,756.97 rows=3,583 width=54) (never executed)

34. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=217,972.52..695,627.31 rows=3,583 width=46) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=217,972.09..647,682.05 rows=11,016 width=34) (never executed)

  • Hash Cond: (jrn_journal.duty_line_id = dty_duty_line_1.duty_line_id)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using jrn_journal_delivery_date on jrn_journal (cost=0.56..417,736.67 rows=513,160 width=26) (never executed)

  • 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[]))
37. 0.000 0.000 ↓ 0.0 0

Hash (cost=213,776.76..213,776.76 rows=255,661 width=8) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Index Scan using dty_duty_line_7e9553 on dty_duty_line dty_duty_line_1 (cost=0.56..213,776.76 rows=255,661 width=8) (never executed)

  • 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))
39. 0.000 0.000 ↓ 0.0 0

Index Scan using dty_duty_line_period_duty_line_id_idx on dty_duty_line_period dty_duty_line_period_1 (cost=0.43..4.34 rows=1 width=20) (never executed)

  • Index Cond: (duty_line_id = jrn_journal.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[]))
40. 0.000 0.000 ↓ 0.0 0

Materialize (cost=84.85..84.87 rows=1 width=8) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Subquery Scan on acc_all_1 (cost=84.85..84.87 rows=1 width=8) (never executed)

42. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=84.85..84.86 rows=1 width=32) (never executed)

  • Group Key: acc_account_group_2.account_id, acc_grant_2.access_code
43. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.59..84.84 rows=1 width=32) (never executed)

44. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.45..84.64 rows=1 width=40) (never executed)

45. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=5.16..59.59 rows=3 width=32) (never executed)

46. 0.000 0.000 ↓ 0.0 0

Index Scan using acc_account_group_idx on acc_account_group acc_account_group_2 (cost=0.42..16.49 rows=3 width=32) (never executed)

  • Index Cond: ((account_id IS NOT NULL) AND (account_id = (current_setting('aysist.uid'::text))::bigint))
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
47. 0.000 0.000 ↓ 0.0 0

Materialize (cost=4.74..43.07 rows=1 width=0) (never executed)

48. 0.000 0.000 ↓ 0.0 0

Subquery Scan on acc_grant_emp (cost=4.74..43.06 rows=1 width=0) (never executed)

49. 0.000 0.000 ↓ 0.0 0

Unique (cost=4.74..43.05 rows=1 width=24) (never executed)

50. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.74..43.05 rows=1 width=24) (never executed)

51. 0.000 0.000 ↓ 0.0 0

Seq Scan on acc_grant_catalog acc_grant_catalog_3 (cost=0.00..2.17 rows=1 width=32) (never executed)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
52. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.74..40.85 rows=3 width=8) (never executed)

53. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on acc_account_group acc_account_group_3 (cost=4.45..15.88 rows=3 width=8) (never executed)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
54. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (never executed)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
55. 0.000 0.000 ↓ 0.0 0

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) (never executed)

  • Index Cond: ((group_id = acc_account_group_3.group_id) AND (grant_catalog_id = acc_grant_catalog_3.grant_catalog_id))
  • Filter: (NOT disable)
56. 0.000 0.000 ↓ 0.0 0

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) (never executed)

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

Index Scan using pk_acc_grant_catalog on acc_grant_catalog acc_grant_catalog_2 (cost=0.14..0.19 rows=1 width=8) (never executed)

  • Index Cond: (grant_catalog_id = acc_grant_2.grant_catalog_id)
  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
58. 0.000 0.000 ↓ 0.0 0

Hash (cost=86.15..86.15 rows=1 width=16) (never executed)

59. 0.000 0.000 ↓ 0.0 0

Subquery Scan on acc_br_1 (cost=86.13..86.15 rows=1 width=16) (never executed)

60. 0.000 0.000 ↓ 0.0 0

HashAggregate (cost=86.13..86.14 rows=1 width=32) (never executed)

  • Group Key: acc_account_group_4.account_id, acc_grant_4.access_code
61. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=9.47..86.12 rows=1 width=32) (never executed)

62. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.74..43.05 rows=1 width=32) (never executed)

63. 0.000 0.000 ↓ 0.0 0

Seq Scan on acc_grant_catalog acc_grant_catalog_4 (cost=0.00..2.17 rows=1 width=8) (never executed)

  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
64. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.74..40.85 rows=3 width=40) (never executed)

65. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on acc_account_group acc_account_group_4 (cost=4.45..15.88 rows=3 width=32) (never executed)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
66. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (never executed)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
67. 0.000 0.000 ↓ 0.0 0

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) (never executed)

  • Index Cond: ((group_id = acc_account_group_4.group_id) AND (grant_catalog_id = acc_grant_catalog_4.grant_catalog_id))
  • Filter: (NOT disable)
68. 0.000 0.000 ↓ 0.0 0

Unique (cost=4.74..43.05 rows=1 width=24) (never executed)

69. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.74..43.05 rows=1 width=24) (never executed)

70. 0.000 0.000 ↓ 0.0 0

Seq Scan on acc_grant_catalog acc_grant_catalog_5 (cost=0.00..2.17 rows=1 width=32) (never executed)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
71. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=4.74..40.85 rows=3 width=8) (never executed)

72. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on acc_account_group acc_account_group_5 (cost=4.45..15.88 rows=3 width=8) (never executed)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
73. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on acc_account_group_idx (cost=0.00..4.45 rows=3 width=0) (never executed)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
74. 0.000 0.000 ↓ 0.0 0

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) (never executed)

  • Index Cond: ((group_id = acc_account_group_5.group_id) AND (grant_catalog_id = acc_grant_catalog_5.grant_catalog_id))
  • Filter: (NOT disable)
75. 365.128 29,977.864 ↑ 1.1 326,247 1

Hash (cost=1,453,576.33..1,453,576.33 rows=346,215 width=727) (actual time=29,977.864..29,977.864 rows=326,247 loops=1)

  • Buckets: 1024 Batches: 64 Memory Usage: 1684kB
76. 578.805 29,612.736 ↑ 1.1 326,247 1

Hash Left Join (cost=350,434.95..1,453,576.33 rows=346,215 width=727) (actual time=2,416.205..29,612.736 rows=326,247 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))
77. 491.883 29,000.905 ↑ 1.1 326,247 1

Hash Left Join (cost=347,572.92..1,441,193.27 rows=346,215 width=739) (actual time=2,383.142..29,000.905 rows=326,247 loops=1)

  • Hash Cond: (dty_duty_line.emp_id = emp_employee.emp_id)
78. 447.104 28,430.424 ↑ 1.1 326,247 1

Hash Left Join (cost=328,701.35..1,414,965.09 rows=346,215 width=705) (actual time=2,304.509..28,430.424 rows=326,247 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: 342661
79. 250.983 27,978.504 ↑ 1.1 326,247 1

Hash Left Join (cost=328,461.72..1,392,295.40 rows=346,215 width=658) (actual time=2,299.676..27,978.504 rows=326,247 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))
80. 276.131 27,727.467 ↑ 1.1 326,247 1

Hash Left Join (cost=328,457.40..1,385,799.54 rows=346,215 width=662) (actual time=2,299.607..27,727.467 rows=326,247 loops=1)

  • Hash Cond: (dty_duty_line.planned_duty_id = aux_duty.duty_id)
81. 10,597.830 27,446.858 ↑ 1.1 326,247 1

Hash Right Join (cost=328,236.85..1,379,805.62 rows=346,215 width=666) (actual time=2,295.117..27,446.858 rows=326,247 loops=1)

  • Hash Cond: (dty_duty_line_period.duty_line_id = dty_duty_line.duty_line_id)
82. 14,566.776 14,566.776 ↓ 1.0 16,643,828 1

Seq Scan on dty_duty_line_period (cost=0.00..623,425.64 rows=16,127,864 width=44) (actual time=0.032..14,566.776 rows=16,643,828 loops=1)

83. 169.684 2,282.252 ↑ 1.0 252,472 1

Hash (cost=304,817.09..304,817.09 rows=255,661 width=622) (actual time=2,282.252..2,282.252 rows=252,472 loops=1)

  • Buckets: 1024 Batches: 64 Memory Usage: 535kB
84. 813.422 2,112.568 ↑ 1.0 252,472 1

Hash Left Join (cost=13,900.64..304,817.09 rows=255,661 width=622) (actual time=190.020..2,112.568 rows=252,472 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: 1892793
85. 291.312 1,109.548 ↑ 1.0 252,472 1

Hash Left Join (cost=4.89..214,770.63 rows=255,661 width=606) (actual time=0.188..1,109.548 rows=252,472 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))
86. 818.180 818.180 ↑ 1.0 252,472 1

Index Scan using dty_duty_line_7e9553 on dty_duty_line (cost=0.56..213,776.76 rows=255,661 width=610) (actual time=0.121..818.180 rows=252,472 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))
87. 0.020 0.056 ↑ 1.0 59 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
88. 0.036 0.036 ↑ 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.009..0.036 rows=59 loops=1)

89. 74.929 189.598 ↓ 1.0 177,001 1

Hash (cost=9,706.01..9,706.01 rows=176,116 width=48) (actual time=189.598..189.598 rows=177,001 loops=1)

  • Buckets: 8192 Batches: 4 Memory Usage: 3483kB
90. 114.669 114.669 ↓ 1.0 177,001 1

Seq Scan on emp_benefit (cost=0.00..9,706.01 rows=176,116 width=48) (actual time=0.006..114.669 rows=177,001 loops=1)

  • Filter: ((flags & 4) <> 4)
91. 2.105 4.478 ↓ 1.0 6,115 1

Hash (cost=144.13..144.13 rows=6,113 width=12) (actual time=4.478..4.478 rows=6,115 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 287kB
92. 2.373 2.373 ↓ 1.0 6,115 1

Seq Scan on aux_duty (cost=0.00..144.13 rows=6,113 width=12) (actual time=0.010..2.373 rows=6,115 loops=1)

93. 0.023 0.054 ↑ 1.0 59 1

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

  • Buckets: 1024 Batches: 1 Memory Usage: 4kB
94. 0.031 0.031 ↑ 1.0 59 1

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

95. 2.328 4.816 ↓ 1.0 5,543 1

Hash (cost=170.39..170.39 rows=5,539 width=63) (actual time=4.816..4.816 rows=5,543 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 495kB
96. 2.488 2.488 ↓ 1.0 5,543 1

Seq Scan on br_dyn customer_br (cost=0.00..170.39 rows=5,539 width=63) (actual time=0.011..2.488 rows=5,543 loops=1)

97. 11.652 78.598 ↑ 1.0 29,181 1

Hash (cost=18,506.81..18,506.81 rows=29,181 width=34) (actual time=78.598..78.598 rows=29,181 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 2002kB
98. 66.946 66.946 ↑ 1.0 29,181 1

Seq Scan on emp_employee (cost=0.00..18,506.81 rows=29,181 width=34) (actual time=0.012..66.946 rows=29,181 loops=1)

99. 13.501 33.026 ↑ 1.0 38,361 1

Hash (cost=2,286.61..2,286.61 rows=38,361 width=20) (actual time=33.026..33.026 rows=38,361 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 2098kB
100. 19.525 19.525 ↑ 1.0 38,361 1

Seq Scan on emp_work_agreement (cost=0.00..2,286.61 rows=38,361 width=20) (actual time=0.009..19.525 rows=38,361 loops=1)

101. 2.146 4.432 ↓ 1.0 5,543 1

Hash (cost=170.39..170.39 rows=5,539 width=63) (actual time=4.432..4.432 rows=5,543 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 495kB
102. 2.286 2.286 ↓ 1.0 5,543 1

Seq Scan on br_dyn emp_br (cost=0.00..170.39 rows=5,539 width=63) (actual time=0.006..2.286 rows=5,543 loops=1)

103. 2.226 4.401 ↓ 1.0 5,543 1

Hash (cost=170.39..170.39 rows=5,539 width=55) (actual time=4.401..4.401 rows=5,543 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 494kB
104. 2.175 2.175 ↓ 1.0 5,543 1

Seq Scan on br_dyn fin_emp_br (cost=0.00..170.39 rows=5,539 width=55) (actual time=0.003..2.175 rows=5,543 loops=1)

105. 0.587 1.171 ↓ 1.0 1,587 1

Hash (cost=38.83..38.83 rows=1,583 width=37) (actual time=1.171..1.171 rows=1,587 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 115kB
106. 0.584 0.584 ↓ 1.0 1,587 1

Seq Scan on aux_function emp_ben_function (cost=0.00..38.83 rows=1,583 width=37) (actual time=0.004..0.584 rows=1,587 loops=1)

107. 2.294 4.460 ↓ 1.0 5,543 1

Hash (cost=170.39..170.39 rows=5,539 width=55) (actual time=4.460..4.460 rows=5,543 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 494kB
108. 2.166 2.166 ↓ 1.0 5,543 1

Seq Scan on br_dyn fin_customer_br (cost=0.00..170.39 rows=5,539 width=55) (actual time=0.003..2.166 rows=5,543 loops=1)

109. 0.000 0.000 ↓ 0.0 0 326,247

Materialize (cost=84.85..84.87 rows=1 width=8) (actual time=0.000..0.000 rows=0 loops=326,247)

110. 0.000 0.080 ↓ 0.0 0 1

Subquery Scan on acc_all (cost=84.85..84.87 rows=1 width=8) (actual time=0.080..0.080 rows=0 loops=1)

111. 0.002 0.080 ↓ 0.0 0 1

HashAggregate (cost=84.85..84.86 rows=1 width=32) (actual time=0.080..0.080 rows=0 loops=1)

  • Group Key: acc_account_group_6.account_id, acc_grant_6.access_code
112. 0.000 0.078 ↓ 0.0 0 1

Nested Loop (cost=5.59..84.84 rows=1 width=32) (actual time=0.078..0.078 rows=0 loops=1)

113. 0.002 0.078 ↓ 0.0 0 1

Nested Loop (cost=5.45..84.64 rows=1 width=40) (actual time=0.078..0.078 rows=0 loops=1)

114. 0.001 0.076 ↓ 0.0 0 1

Nested Loop (cost=5.16..59.59 rows=3 width=32) (actual time=0.076..0.076 rows=0 loops=1)

115. 0.027 0.027 ↑ 3.0 1 1

Index Scan using acc_account_group_idx on acc_account_group acc_account_group_6 (cost=0.42..16.49 rows=3 width=32) (actual time=0.027..0.027 rows=1 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()))
116. 0.002 0.048 ↓ 0.0 0 1

Materialize (cost=4.74..43.07 rows=1 width=0) (actual time=0.048..0.048 rows=0 loops=1)

117. 0.001 0.046 ↓ 0.0 0 1

Subquery Scan on acc_grant_emp_1 (cost=4.74..43.06 rows=1 width=0) (actual time=0.046..0.046 rows=0 loops=1)

118. 0.000 0.045 ↓ 0.0 0 1

Unique (cost=4.74..43.05 rows=1 width=24) (actual time=0.045..0.045 rows=0 loops=1)

119. 0.011 0.045 ↓ 0.0 0 1

Nested Loop (cost=4.74..43.05 rows=1 width=24) (actual time=0.045..0.045 rows=0 loops=1)

120. 0.016 0.016 ↑ 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.007..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
121. 0.003 0.018 ↓ 0.0 0 1

Nested Loop (cost=4.74..40.85 rows=3 width=8) (actual time=0.018..0.018 rows=0 loops=1)

122. 0.007 0.010 ↑ 3.0 1 1

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

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
123. 0.003 0.003 ↑ 3.0 1 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=1 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
124. 0.005 0.005 ↓ 0.0 0 1

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.005..0.005 rows=0 loops=1)

  • Index Cond: ((group_id = acc_account_group_7.group_id) AND (grant_catalog_id = acc_grant_catalog_7.grant_catalog_id))
  • Filter: (NOT disable)
125. 0.000 0.000 ↓ 0.0 0

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) (never executed)

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

Index Scan using pk_acc_grant_catalog on acc_grant_catalog acc_grant_catalog_6 (cost=0.14..0.19 rows=1 width=8) (never executed)

  • Index Cond: (grant_catalog_id = acc_grant_6.grant_catalog_id)
  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
127. 0.000 0.078 ↓ 0.0 0 1

Hash (cost=86.15..86.15 rows=1 width=16) (actual time=0.078..0.078 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 0kB
128. 0.002 0.078 ↓ 0.0 0 1

Subquery Scan on acc_br (cost=86.13..86.15 rows=1 width=16) (actual time=0.078..0.078 rows=0 loops=1)

129. 0.002 0.076 ↓ 0.0 0 1

HashAggregate (cost=86.13..86.14 rows=1 width=32) (actual time=0.076..0.076 rows=0 loops=1)

  • Group Key: acc_account_group_8.account_id, acc_grant_8.access_code
130. 0.002 0.074 ↓ 0.0 0 1

Nested Loop (cost=9.47..86.12 rows=1 width=32) (actual time=0.074..0.074 rows=0 loops=1)

131. 0.009 0.036 ↑ 1.0 1 1

Nested Loop (cost=4.74..43.05 rows=1 width=32) (actual time=0.028..0.036 rows=1 loops=1)

132. 0.011 0.011 ↑ 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.005..0.011 rows=1 loops=1)

  • Filter: (((type)::text = 'DATA'::text) AND ((name)::text = 'COST_CENTER'::text))
  • Rows Removed by Filter: 77
133. 0.002 0.016 ↑ 3.0 1 1

Nested Loop (cost=4.74..40.85 rows=3 width=40) (actual time=0.015..0.016 rows=1 loops=1)

134. 0.008 0.010 ↑ 3.0 1 1

Bitmap Heap Scan on acc_account_group acc_account_group_8 (cost=4.45..15.88 rows=3 width=32) (actual time=0.009..0.010 rows=1 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
135. 0.002 0.002 ↑ 3.0 1 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=1 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
136. 0.004 0.004 ↑ 1.0 1 1

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.004..0.004 rows=1 loops=1)

  • Index Cond: ((group_id = acc_account_group_8.group_id) AND (grant_catalog_id = acc_grant_catalog_8.grant_catalog_id))
  • Filter: (NOT disable)
137. 0.001 0.036 ↓ 0.0 0 1

Unique (cost=4.74..43.05 rows=1 width=24) (actual time=0.036..0.036 rows=0 loops=1)

138. 0.005 0.035 ↓ 0.0 0 1

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

139. 0.019 0.019 ↑ 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.010..0.019 rows=1 loops=1)

  • Filter: ((name IS NOT NULL) AND ((type)::text = 'LOGIC'::text) AND ((name)::text = 'EMPLOYEECARD'::text))
  • Rows Removed by Filter: 77
140. 0.002 0.011 ↓ 0.0 0 1

Nested Loop (cost=4.74..40.85 rows=3 width=8) (actual time=0.011..0.011 rows=0 loops=1)

141. 0.006 0.008 ↑ 3.0 1 1

Bitmap Heap Scan on acc_account_group acc_account_group_9 (cost=4.45..15.88 rows=3 width=8) (actual time=0.007..0.008 rows=1 loops=1)

  • Recheck Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
  • Filter: ((valid_from <= now()) AND (valid_to > now()))
  • Heap Blocks: exact=1
142. 0.002 0.002 ↑ 3.0 1 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=1 loops=1)

  • Index Cond: (account_id = (current_setting('aysist.uid'::text))::bigint)
143. 0.001 0.001 ↓ 0.0 0 1

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.001..0.001 rows=0 loops=1)

  • Index Cond: ((group_id = acc_account_group_9.group_id) AND (grant_catalog_id = acc_grant_catalog_9.grant_catalog_id))
  • Filter: (NOT disable)