Re: [GENERAL] Function performance drops during execution of loop

2014-05-21 Thread Seref Arikan
Just for the record, I've increased the data volume X10 and observed only quite small performance drop: average time per inner function call increased from 12.6 ms to 13.3 ms. Regards Seref On Wed, May 21, 2014 at 5:19 PM, Seref Arikan < serefari...@kurumsalteknoloji.com> wrote: > Thanks a lot

Re: [GENERAL] Function performance drops during execution of loop

2014-05-21 Thread Seref Arikan
Thanks a lot for the hint Tom! I've replaced deletes with TRUNCATE and it gave a performance of 50.950 sec which is twice as fast as the drop temp table method, with the added benefit of not having to raise the max_locks_per_transaction. I also think I can't see the performance decrease pattern an

Re: [GENERAL] Function performance drops during execution of loop

2014-05-21 Thread Seref Arikan
Hi Tom, Thanks for the feedback. I've moved the temp tables to internal function, increased max_locks_per_transaction and dropped the tables instead of deleting them. The performance drop is till there, but it is much, much less then the previous case. Previously the whole execution took 04:36:14

Re: [GENERAL] Function performance drops during execution of loop

2014-05-21 Thread Tom Lane
Seref Arikan writes: > What may be building up here? I suspect deleting all rows from the temp > tables is not really deleting them since this is all happening in a > transaction, but it is my uneducated guess only. I suspect you suspect correctly. Autovacuum does not touch temp tables, so it wo

[GENERAL] Function performance drops during execution of loop

2014-05-21 Thread Seref Arikan
Greetings, I have a function that loops over a set of ids, calls a function inside the loop using the current id as the parameter, and adds the result of the function call to a temp table. When the loop terminates, the temp table has all the rows from the function call(s) and it is returned. I've