Hi
2016-03-06 18:41 GMT+01:00 Alexander Farber <alexander.farber@xxxxxxxxx>:
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@xxxxxxxxx> wrote:On Sun, Mar 6, 2016 at 9:22 AM, Alexander Farber <alexander.farber@xxxxxxxxx> 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.