We request you to please provide some assistance on below issue and it is impacting the migration project.
I suggest you try and re-write the loop-based function into a set-oriented view.
Specifically, I think doing: "array_agg(DISTINCT paymenttype)" and then checking for various array results will be considerably more efficient.
Or do a combination: write the set-oriented query in an SQL function. You should not need pl/pgsql for this and avoiding it should improve performance.
David J.
p.s., The convention on these lists is to inline post and remove unneeded context. Or at least bottom post.
Чтобы сделать работу с сайтом удобнее, мы используем cookie и аналитический сервис «Яндекс.Метрика». Продолжая пользоваться сайтом, вы соглашаетесь с их использованием.