Re: Query Tunning related to function

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Query Tunning related to function
Дата
Msg-id CAKFQuwYuRptm3SrSomOFgbA8gvgyHc_g8MEGmEjV_gJoMitccA@mail.gmail.com
обсуждение исходный текст
Ответ на RE: Query Tunning related to function  ("Kumar, Mukesh" <MKumar@peabodyenergy.com>)
Список pgsql-performance
On Sun, Apr 17, 2022 at 8:53 AM Kumar, Mukesh <MKumar@peabodyenergy.com> wrote:

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.

В списке pgsql-performance по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Query Planner not taking advantage of HASH PARTITION
Следующее
От: Benjamin Tingle
Дата:
Сообщение: Re: Query Planner not taking advantage of HASH PARTITION