Re: Subtract one array from another, both with non-unique elements

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Subtract one array from another, both with non-unique elements
Дата
Msg-id CAFj8pRAT3ZRrKoLtoL23OdEObAKAYxcArYm83+e5oAsWNN2Eig@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Subtract one array from another, both with non-unique elements  (Alexander Farber <alexander.farber@gmail.com>)
Ответы Re: Subtract one array from another, both with non-unique elements  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
Hi

2016-03-06 18:41 GMT+01:00 Alexander Farber <alexander.farber@gmail.com>:
Thank you, but shouldn't I better use FOREACH for my task?


SQL based solution (functional based) solution can be faster and shorter. PLpgSQL is nice language, but what you can do about arrays functionally, you should to do :). Usually it is significantly faster.

But, you can try - it is good example for learning, try to implement it different ways and compare speed.

Pavel
 

On Sun, Mar 6, 2016 at 6:34 PM, bricklen <bricklen@gmail.com> wrote:
On Sun, Mar 6, 2016 at 9:22 AM, Alexander Farber <alexander.farber@gmail.com> wrote:
could someone please recommend the most efficient way subtracting elements of one array from the other in PostgreSQL 9.5?

There are quite a few examples of array functions at http://postgres.cz/wiki/Array_based_functions, probably worth having a look.


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

Предыдущее
От: Alexander Farber
Дата:
Сообщение: Re: Subtract one array from another, both with non-unique elements
Следующее
От:
Дата:
Сообщение: Does a call to a language handler provide a context/session, and somewhere to keep session data?