explain.depesz.com

A tool for finding a real cause for slow queries.

Result: S0K

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.135 152,602.592 ↑ 4.3 75 1

Sort (cost=686,558.68..686,559.48 rows=323 width=105) (actual time=152,602.586..152,602.592 rows=75 loops=1)

  • Sort Key: public.brokerage_accounting.ibc_settlement_received, public.brokerage_accounting.accounting_number_p1
  • Sort Method: quicksort Memory: 35kB
2. 0.675 152,602.457 ↑ 4.3 75 1

HashAggregate (cost=686,541.98..686,545.21 rows=323 width=105) (actual time=152,602.412..152,602.457 rows=75 loops=1)

3. 0.062 152,601.782 ↑ 4.3 75 1

Append (cost=28,282.29..686,530.68 rows=323 width=105) (actual time=35,858.356..152,601.782 rows=75 loops=1)

4. 0.080 36,789.604 ↑ 11.0 29 1

Hash Anti Join (cost=28,282.29..219,417.54 rows=320 width=77) (actual time=35,858.354..36,789.604 rows=29 loops=1)

  • Hash Cond: (public.brokerage_accounting.id = public.payout.accounting)
5. 0.035 36,789.523 ↑ 11.0 29 1

Hash Join (cost=28,259.85..219,388.66 rows=320 width=77) (actual time=35,858.318..36,789.523 rows=29 loops=1)

  • Hash Cond: (public.brokerage_accounting.assurance_sub_company = public.assurance_sub_company.id)
6. 0.230 36,789.281 ↑ 11.0 29 1

Hash Join (cost=28,241.87..219,366.27 rows=320 width=77) (actual time=35,858.095..36,789.281 rows=29 loops=1)

  • Hash Cond: (public.brokerage_accounting.contract = v_contract_search.id)
7. 1.839 35,904.811 ↑ 2.2 29 1

Hash Join (cost=71.79..190,109.89 rows=63 width=77) (actual time=34,973.702..35,904.811 rows=29 loops=1)

  • Hash Cond: (public.brokerage_accounting.partner = t2.id)
  • Join Filter: (t2.commission_released OR (public.brokerage_accounting.payout_amount_p1 < 0::numeric))
8. 35,901.904 35,901.904 ↑ 1.2 1,539 1

Seq Scan on brokerage_accounting (cost=0.00..190,008.48 rows=1,823 width=77) (actual time=28,685.643..35,901.904 rows=1,539 loops=1)

  • Filter: ((bank_statement_number IS NOT NULL) AND (NOT ambiguous_accounting) AND ((accounting_number_p1)::text ~~* '%aktuell%'::text))
9. 0.206 1.068 ↑ 1.0 835 1

Hash (cost=61.35..61.35 rows=835 width=5) (actual time=1.068..1.068 rows=835 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
10. 0.862 0.862 ↑ 1.0 835 1

Seq Scan on partner t2 (cost=0.00..61.35 rows=835 width=5) (actual time=0.012..0.862 rows=835 loops=1)

11. 58.362 884.240 ↑ 1.0 137,519 1

Hash (cost=26,451.09..26,451.09 rows=137,519 width=4) (actual time=884.240..884.240 rows=137,519 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 4835kB
12. 24.074 825.878 ↑ 1.0 137,519 1

Subquery Scan on v_contract_search (cost=2,062.90..26,451.09 rows=137,519 width=4) (actual time=42.248..825.878 rows=137,519 loops=1)

13. 229.822 801.804 ↑ 1.0 137,519 1

Hash Join (cost=2,062.90..25,075.90 rows=137,519 width=751) (actual time=42.247..801.804 rows=137,519 loops=1)

  • Hash Cond: (public.contract.product = public.product.id)
14. 73.786 571.934 ↑ 1.0 137,519 1

Hash Join (cost=2,060.30..19,400.65 rows=137,519 width=748) (actual time=42.158..571.934 rows=137,519 loops=1)

  • Hash Cond: (public.contract.assurance_sub_company = public.assurance_sub_company.id)
15. 161.073 497.971 ↑ 1.0 137,519 1

Hash Join (cost=2,042.32..17,491.77 rows=137,519 width=727) (actual time=41.968..497.971 rows=137,519 loops=1)

  • Hash Cond: (public.contract.customer = public.customer.id)
16. 164.719 295.866 ↑ 1.0 137,519 1

Hash Join (cost=71.79..12,770.86 rows=137,519 width=712) (actual time=0.872..295.866 rows=137,519 loops=1)

  • Hash Cond: (public.contract.partner = public.partner.id)
17. 130.331 130.331 ↑ 1.0 137,519 1

Seq Scan on contract (cost=0.00..10,808.19 rows=137,519 width=693) (actual time=0.031..130.331 rows=137,519 loops=1)

18. 0.269 0.816 ↑ 1.0 835 1

Hash (cost=61.35..61.35 rows=835 width=19) (actual time=0.816..0.816 rows=835 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 44kB
19. 0.547 0.547 ↑ 1.0 835 1

Seq Scan on partner (cost=0.00..61.35 rows=835 width=19) (actual time=0.006..0.547 rows=835 loops=1)

20. 16.682 41.032 ↑ 1.0 46,468 1

Hash (cost=1,389.68..1,389.68 rows=46,468 width=19) (actual time=41.032..41.032 rows=46,468 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2418kB
21. 24.350 24.350 ↑ 1.0 46,468 1

Seq Scan on customer (cost=0.00..1,389.68 rows=46,468 width=19) (actual time=0.011..24.350 rows=46,468 loops=1)

22. 0.093 0.177 ↑ 1.0 266 1

Hash (cost=14.66..14.66 rows=266 width=25) (actual time=0.177..0.177 rows=266 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
23. 0.084 0.084 ↑ 1.0 266 1

Seq Scan on assurance_sub_company (cost=0.00..14.66 rows=266 width=25) (actual time=0.004..0.084 rows=266 loops=1)

24. 0.022 0.048 ↑ 1.0 71 1

Hash (cost=1.71..1.71 rows=71 width=7) (actual time=0.048..0.048 rows=71 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
25. 0.026 0.026 ↑ 1.0 71 1

Seq Scan on product (cost=0.00..1.71 rows=71 width=7) (actual time=0.012..0.026 rows=71 loops=1)

26. 0.082 0.207 ↑ 1.0 266 1

Hash (cost=14.66..14.66 rows=266 width=4) (actual time=0.207..0.207 rows=266 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
27. 0.125 0.125 ↑ 1.0 266 1

Seq Scan on assurance_sub_company (cost=0.00..14.66 rows=266 width=4) (actual time=0.007..0.125 rows=266 loops=1)

28. 0.000 0.001 ↓ 0.0 0 1

Hash (cost=22.38..22.38 rows=5 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 0kB
29. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on payout (cost=0.00..22.38 rows=5 width=4) (actual time=0.001..0.001 rows=0 loops=1)

  • Filter: (reference = 1)
30. 0.001 35,597.617 ↓ 0.0 0 1

Nested Loop Anti Join (cost=2,067.19..218,209.58 rows=1 width=64) (actual time=35,597.617..35,597.617 rows=0 loops=1)

31. 0.001 35,597.616 ↓ 0.0 0 1

Nested Loop (cost=2,062.90..218,195.12 rows=1 width=64) (actual time=35,597.616..35,597.616 rows=0 loops=1)

  • Join Filter: (public.brokerage_accounting.contract = public.contract.id)
32. 0.000 35,597.615 ↓ 0.0 0 1

Nested Loop (cost=0.00..190,025.04 rows=1 width=64) (actual time=35,597.615..35,597.615 rows=0 loops=1)

  • Join Filter: (t2.commission_released OR (public.brokerage_accounting.payout_amount_p2 < 0::numeric))
33. 0.002 35,597.615 ↓ 0.0 0 1

Nested Loop (cost=0.00..190,016.76 rows=1 width=64) (actual time=35,597.615..35,597.615 rows=0 loops=1)

34. 35,597.613 35,597.613 ↓ 0.0 0 1

Seq Scan on brokerage_accounting (cost=0.00..190,008.48 rows=1 width=64) (actual time=35,597.613..35,597.613 rows=0 loops=1)

  • Filter: ((bank_statement_number IS NOT NULL) AND (NOT ambiguous_accounting) AND ((accounting_number_p2)::text ~~* '%aktuell%'::text))
35. 0.000 0.000 ↓ 0.0 0

Index Scan using assurance_sub_company_pkey on assurance_sub_company (cost=0.00..8.27 rows=1 width=4) (actual time=.. rows= loops=0)

  • Index Cond: (id = public.brokerage_accounting.assurance_sub_company)
36. 0.000 0.000 ↓ 0.0 0

Index Scan using partner_pkey on partner t2 (cost=0.00..8.27 rows=1 width=5) (actual time=.. rows= loops=0)

  • Index Cond: (id = public.brokerage_accounting.introducing_partner)
37. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=2,062.90..25,075.90 rows=137,519 width=751) (actual time=.. rows= loops=0)

  • Hash Cond: (public.contract.product = public.product.id)
38. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=2,060.30..19,400.65 rows=137,519 width=748) (actual time=.. rows= loops=0)

  • Hash Cond: (public.contract.assurance_sub_company = public.assurance_sub_company.id)
39. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=2,042.32..17,491.77 rows=137,519 width=727) (actual time=.. rows= loops=0)

  • Hash Cond: (public.contract.customer = public.customer.id)
40. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=71.79..12,770.86 rows=137,519 width=712) (actual time=.. rows= loops=0)

  • Hash Cond: (public.contract.partner = public.partner.id)
41. 0.000 0.000 ↓ 0.0 0

Seq Scan on contract (cost=0.00..10,808.19 rows=137,519 width=693) (actual time=.. rows= loops=0)

42. 0.000 0.000 ↓ 0.0 0

Hash (cost=61.35..61.35 rows=835 width=19) (actual time=.. rows= loops=0)

43. 0.000 0.000 ↓ 0.0 0

Seq Scan on partner (cost=0.00..61.35 rows=835 width=19) (actual time=.. rows= loops=0)

44. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,389.68..1,389.68 rows=46,468 width=19) (actual time=.. rows= loops=0)

45. 0.000 0.000 ↓ 0.0 0

Seq Scan on customer (cost=0.00..1,389.68 rows=46,468 width=19) (actual time=.. rows= loops=0)

46. 0.000 0.000 ↓ 0.0 0

Hash (cost=14.66..14.66 rows=266 width=25) (actual time=.. rows= loops=0)

47. 0.000 0.000 ↓ 0.0 0

Seq Scan on assurance_sub_company (cost=0.00..14.66 rows=266 width=25) (actual time=.. rows= loops=0)

48. 0.000 0.000 ↓ 0.0 0

Hash (cost=1.71..1.71 rows=71 width=7) (actual time=.. rows= loops=0)

49. 0.000 0.000 ↓ 0.0 0

Seq Scan on product (cost=0.00..1.71 rows=71 width=7) (actual time=.. rows= loops=0)

50. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on payout (cost=4.29..12.76 rows=5 width=4) (actual time=.. rows= loops=0)

  • Recheck Cond: (public.brokerage_accounting.id = accounting)
  • Filter: (reference = 2)
51. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fki_brokerage_accounting_payout (cost=0.00..4.29 rows=5 width=0) (actual time=.. rows= loops=0)

  • Index Cond: (public.brokerage_accounting.id = accounting)
52. 0.799 80,177.856 ↓ 46.0 46 1

Nested Loop Anti Join (cost=2,134.98..218,268.15 rows=1 width=67) (actual time=39,366.345..80,177.856 rows=46 loops=1)

53. 1,100.606 80,176.505 ↓ 46.0 46 1

Nested Loop (cost=2,134.69..218,257.68 rows=1 width=67) (actual time=39,366.294..80,176.505 rows=46 loops=1)

  • Join Filter: (public.brokerage_accounting.contract = public.contract.id)
54. 0.376 45,176.843 ↓ 46.0 46 1

Nested Loop (cost=71.79..190,087.60 rows=1 width=67) (actual time=39,142.923..45,176.843 rows=46 loops=1)

55. 2.796 45,175.639 ↓ 46.0 46 1

Hash Join (cost=71.79..190,082.57 rows=1 width=67) (actual time=39,142.899..45,175.639 rows=46 loops=1)

  • Hash Cond: (public.brokerage_accounting.partner_nv1 = t2.id)
  • Join Filter: (t2.commission_released OR (public.brokerage_accounting.payout_amount_p3 < 0::numeric))
56. 45,171.583 45,171.583 ↓ 2.0 1,056 1

Seq Scan on brokerage_accounting (cost=0.00..190,008.48 rows=518 width=67) (actual time=37,787.502..45,171.583 rows=1,056 loops=1)

  • Filter: ((bank_statement_number IS NOT NULL) AND (NOT ambiguous_accounting) AND ((accounting_number_p3)::text ~~* '%aktuell%'::text))
57. 0.327 1.260 ↑ 1.0 835 1

Hash (cost=61.35..61.35 rows=835 width=5) (actual time=1.260..1.260 rows=835 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
58. 0.933 0.933 ↑ 1.0 835 1

Seq Scan on partner t2 (cost=0.00..61.35 rows=835 width=5) (actual time=0.011..0.933 rows=835 loops=1)

59. 0.828 0.828 ↑ 1.0 1 46

Index Scan using assurance_sub_company_pkey on assurance_sub_company (cost=0.00..5.02 rows=1 width=4) (actual time=0.014..0.018 rows=1 loops=46)

  • Index Cond: (id = public.brokerage_accounting.assurance_sub_company)
60. 11,052.698 33,899.056 ↑ 1.0 137,519 46

Hash Join (cost=2,062.90..25,075.90 rows=137,519 width=751) (actual time=0.825..736.936 rows=137,519 loops=46)

  • Hash Cond: (public.contract.product = public.product.id)
61. 3,427.877 22,846.314 ↑ 1.0 137,519 46

Hash Join (cost=2,060.30..19,400.65 rows=137,519 width=748) (actual time=0.815..496.659 rows=137,519 loops=46)

  • Hash Cond: (public.contract.assurance_sub_company = public.assurance_sub_company.id)
62. 7,333.213 19,418.256 ↑ 1.0 137,519 46

Hash Join (cost=2,042.32..17,491.77 rows=137,519 width=727) (actual time=0.809..422.136 rows=137,519 loops=46)

  • Hash Cond: (public.contract.customer = public.customer.id)
63. 7,510.187 12,049.378 ↑ 1.0 137,519 46

Hash Join (cost=71.79..12,770.86 rows=137,519 width=712) (actual time=0.029..261.943 rows=137,519 loops=46)

  • Hash Cond: (public.contract.partner = public.partner.id)
64. 4,538.268 4,538.268 ↑ 1.0 137,519 46

Seq Scan on contract (cost=0.00..10,808.19 rows=137,519 width=693) (actual time=0.004..98.658 rows=137,519 loops=46)

65. 0.296 0.923 ↑ 1.0 835 1

Hash (cost=61.35..61.35 rows=835 width=19) (actual time=0.923..0.923 rows=835 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 44kB
66. 0.627 0.627 ↑ 1.0 835 1

Seq Scan on partner (cost=0.00..61.35 rows=835 width=19) (actual time=0.006..0.627 rows=835 loops=1)

67. 15.479 35.665 ↑ 1.0 46,468 1

Hash (cost=1,389.68..1,389.68 rows=46,468 width=19) (actual time=35.665..35.665 rows=46,468 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2418kB
68. 20.186 20.186 ↑ 1.0 46,468 1

Seq Scan on customer (cost=0.00..1,389.68 rows=46,468 width=19) (actual time=0.007..20.186 rows=46,468 loops=1)

69. 0.099 0.181 ↑ 1.0 266 1

Hash (cost=14.66..14.66 rows=266 width=25) (actual time=0.181..0.181 rows=266 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
70. 0.082 0.082 ↑ 1.0 266 1

Seq Scan on assurance_sub_company (cost=0.00..14.66 rows=266 width=25) (actual time=0.004..0.082 rows=266 loops=1)

71. 0.025 0.044 ↑ 1.0 71 1

Hash (cost=1.71..1.71 rows=71 width=7) (actual time=0.044..0.044 rows=71 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
72. 0.019 0.019 ↑ 1.0 71 1

Seq Scan on product (cost=0.00..1.71 rows=71 width=7) (actual time=0.008..0.019 rows=71 loops=1)

73. 0.230 0.552 ↓ 0.0 0 46

Bitmap Heap Scan on payout (cost=0.30..8.77 rows=5 width=4) (actual time=0.012..0.012 rows=0 loops=46)

  • Recheck Cond: (public.brokerage_accounting.id = accounting)
  • Filter: (reference = 3)
74. 0.322 0.322 ↓ 0.0 0 46

Bitmap Index Scan on fki_brokerage_accounting_payout (cost=0.00..0.30 rows=5 width=0) (actual time=0.007..0.007 rows=0 loops=46)

  • Index Cond: (public.brokerage_accounting.id = accounting)
75. 0.001 36.643 ↓ 0.0 0 1

Nested Loop Anti Join (cost=5,706.56..30,628.95 rows=1 width=64) (actual time=36.643..36.643 rows=0 loops=1)

76. 0.001 36.642 ↓ 0.0 0 1

Nested Loop (cost=5,702.27..30,614.49 rows=1 width=64) (actual time=36.642..36.642 rows=0 loops=1)

77. 0.039 36.641 ↓ 0.0 0 1

Hash Join (cost=5,702.27..30,606.21 rows=1 width=64) (actual time=36.641..36.641 rows=0 loops=1)

  • Hash Cond: (public.contract.id = public.brokerage_accounting.contract)
78. 0.078 35.853 ↑ 137,519.0 1 1

Hash Join (cost=2,062.90..25,075.90 rows=137,519 width=751) (actual time=35.853..35.853 rows=1 loops=1)

  • Hash Cond: (public.contract.product = public.product.id)
79. 0.017 35.734 ↑ 137,519.0 1 1

Hash Join (cost=2,060.30..19,400.65 rows=137,519 width=748) (actual time=35.734..35.734 rows=1 loops=1)

  • Hash Cond: (public.contract.assurance_sub_company = public.assurance_sub_company.id)
80. 0.066 35.543 ↑ 137,519.0 1 1

Hash Join (cost=2,042.32..17,491.77 rows=137,519 width=727) (actual time=35.543..35.543 rows=1 loops=1)

  • Hash Cond: (public.contract.customer = public.customer.id)
81. 0.022 0.836 ↑ 137,519.0 1 1

Hash Join (cost=71.79..12,770.86 rows=137,519 width=712) (actual time=0.836..0.836 rows=1 loops=1)

  • Hash Cond: (public.contract.partner = public.partner.id)
82. 0.004 0.004 ↑ 137,519.0 1 1

Seq Scan on contract (cost=0.00..10,808.19 rows=137,519 width=693) (actual time=0.004..0.004 rows=1 loops=1)

83. 0.284 0.810 ↑ 1.0 835 1

Hash (cost=61.35..61.35 rows=835 width=19) (actual time=0.810..0.810 rows=835 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 44kB
84. 0.526 0.526 ↑ 1.0 835 1

Seq Scan on partner (cost=0.00..61.35 rows=835 width=19) (actual time=0.006..0.526 rows=835 loops=1)

85. 15.017 34.641 ↑ 1.0 46,468 1

Hash (cost=1,389.68..1,389.68 rows=46,468 width=19) (actual time=34.641..34.641 rows=46,468 loops=1)

  • Buckets: 8192 Batches: 1 Memory Usage: 2418kB
86. 19.624 19.624 ↑ 1.0 46,468 1

Seq Scan on customer (cost=0.00..1,389.68 rows=46,468 width=19) (actual time=0.007..19.624 rows=46,468 loops=1)

87. 0.099 0.174 ↑ 1.0 266 1

Hash (cost=14.66..14.66 rows=266 width=25) (actual time=0.174..0.174 rows=266 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 16kB
88. 0.075 0.075 ↑ 1.0 266 1

Seq Scan on assurance_sub_company (cost=0.00..14.66 rows=266 width=25) (actual time=0.004..0.075 rows=266 loops=1)

89. 0.022 0.041 ↑ 1.0 71 1

Hash (cost=1.71..1.71 rows=71 width=7) (actual time=0.041..0.041 rows=71 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 3kB
90. 0.019 0.019 ↑ 1.0 71 1

Seq Scan on product (cost=0.00..1.71 rows=71 width=7) (actual time=0.008..0.019 rows=71 loops=1)

91. 0.001 0.749 ↓ 0.0 0 1

Hash (cost=3,639.36..3,639.36 rows=1 width=64) (actual time=0.749..0.749 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 0kB
92. 0.562 0.748 ↓ 0.0 0 1

Nested Loop (cost=0.00..3,639.36 rows=1 width=64) (actual time=0.748..0.748 rows=0 loops=1)

  • Join Filter: (t2.commission_released OR (public.brokerage_accounting.payout_amount_p4 < 0::numeric))
93. 0.186 0.186 ↑ 1.0 835 1

Seq Scan on partner t2 (cost=0.00..61.35 rows=835 width=5) (actual time=0.005..0.186 rows=835 loops=1)

94. 0.000 0.000 ↓ 0.0 0 835

Index Scan using partner_nv2_idx on brokerage_accounting (cost=0.00..4.27 rows=1 width=64) (actual time=0.000..0.000 rows=0 loops=835)

  • Index Cond: (partner_nv2 = t2.id)
  • Filter: ((bank_statement_number IS NOT NULL) AND (NOT ambiguous_accounting) AND ((accounting_number_p4)::text ~~* '%aktuell%'::text))
95. 0.000 0.000 ↓ 0.0 0

Index Scan using assurance_sub_company_pkey on assurance_sub_company (cost=0.00..8.27 rows=1 width=4) (actual time=.. rows= loops=0)

  • Index Cond: (id = public.brokerage_accounting.assurance_sub_company)
96. 0.000 0.000 ↓ 0.0 0

Bitmap Heap Scan on payout (cost=4.29..12.76 rows=5 width=4) (actual time=.. rows= loops=0)

  • Recheck Cond: (public.brokerage_accounting.id = accounting)
  • Filter: (reference = 4)
97. 0.000 0.000 ↓ 0.0 0

Bitmap Index Scan on fki_brokerage_accounting_payout (cost=0.00..4.29 rows=5 width=0) (actual time=.. rows= loops=0)

  • Index Cond: (public.brokerage_accounting.id = accounting)