Re: calling procedures is slow and consumes extra much memory against calling function

2020-09-29 Thread Pavel Stehule
út 29. 9. 2020 v 17:20 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > I agree with these conclusions. I'll try to look if I can do #2 patch > > better for pg14. Probably it can fix more issues related to CALL > statement, > > and I agree so this should not be backapatched. > > I've pus

Re: calling procedures is slow and consumes extra much memory against calling function

2020-09-29 Thread Tom Lane
Pavel Stehule writes: > I agree with these conclusions. I'll try to look if I can do #2 patch > better for pg14. Probably it can fix more issues related to CALL statement, > and I agree so this should not be backapatched. I've pushed this and marked the CF entry committed. Please start a new th

Re: calling procedures is slow and consumes extra much memory against calling function

2020-09-28 Thread Pavel Stehule
po 28. 9. 2020 v 3:04 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > I am sending another patch that tries to allow CachedPlans for CALL > > statements. I think this patch is very accurate, but it is not nice, > > because it is smudging very precious reference counting for CachedPlans.

Re: calling procedures is slow and consumes extra much memory against calling function

2020-09-27 Thread Tom Lane
Pavel Stehule writes: > I am sending another patch that tries to allow CachedPlans for CALL > statements. I think this patch is very accurate, but it is not nice, > because it is smudging very precious reference counting for CachedPlans. I spent some time testing this. Although the #1 patch gets

Re: calling procedures is slow and consumes extra much memory against calling function

2020-09-17 Thread Amit Khandekar
On Thu, 17 Sep 2020 at 11:07, Michael Paquier wrote: > > On Thu, Jul 16, 2020 at 09:08:09PM +0200, Pavel Stehule wrote: > > I am sending another patch that tries to allow CachedPlans for CALL > > statements. I think this patch is very accurate, but it is not nice, > > because it is smudging very p

Re: calling procedures is slow and consumes extra much memory against calling function

2020-09-16 Thread Michael Paquier
On Thu, Jul 16, 2020 at 09:08:09PM +0200, Pavel Stehule wrote: > I am sending another patch that tries to allow CachedPlans for CALL > statements. I think this patch is very accurate, but it is not nice, > because it is smudging very precious reference counting for CachedPlans. Amit, you are regis

Re: calling procedures is slow and consumes extra much memory against calling function

2020-07-16 Thread Pavel Stehule
Hi I am sending another patch that tries to allow CachedPlans for CALL statements. I think this patch is very accurate, but it is not nice, because it is smudging very precious reference counting for CachedPlans. Current issue: == I found a problem with repeated CALL statements from DO c

Re: calling procedures is slow and consumes extra much memory against calling function

2020-07-12 Thread Pavel Stehule
so 11. 7. 2020 v 7:38 odesílatel Pavel Stehule napsal: > > > čt 9. 7. 2020 v 8:28 odesílatel Amit Khandekar > napsal: > >> On Wed, 17 Jun 2020 at 13:54, Pavel Stehule >> wrote: >> > >> > >> > >> > st 17. 6. 2020 v 7:52 odesílatel Amit Khandekar >> napsal: >> >> >> >> On Wed, 10 Jun 2020 at 17:

Re: calling procedures is slow and consumes extra much memory against calling function

2020-07-10 Thread Pavel Stehule
čt 9. 7. 2020 v 8:28 odesílatel Amit Khandekar napsal: > On Wed, 17 Jun 2020 at 13:54, Pavel Stehule > wrote: > > > > > > > > st 17. 6. 2020 v 7:52 odesílatel Amit Khandekar > napsal: > >> > >> On Wed, 10 Jun 2020 at 17:12, Pavel Stehule > wrote: > >> > st 10. 6. 2020 v 12:26 odesílatel Amit K

Re: calling procedures is slow and consumes extra much memory against calling function

2020-07-08 Thread Amit Khandekar
On Wed, 17 Jun 2020 at 13:54, Pavel Stehule wrote: > > > > st 17. 6. 2020 v 7:52 odesílatel Amit Khandekar > napsal: >> >> On Wed, 10 Jun 2020 at 17:12, Pavel Stehule wrote: >> > st 10. 6. 2020 v 12:26 odesílatel Amit Khandekar >> > napsal: >> >> Could you show an example testcase that tests

Re: calling procedures is slow and consumes extra much memory against calling function

2020-06-17 Thread Pavel Stehule
st 17. 6. 2020 v 7:52 odesílatel Amit Khandekar napsal: > On Wed, 10 Jun 2020 at 17:12, Pavel Stehule > wrote: > > st 10. 6. 2020 v 12:26 odesílatel Amit Khandekar > napsal: > >> Could you show an example testcase that tests this recursive scenario, > >> with which your earlier patch fails the

Re: calling procedures is slow and consumes extra much memory against calling function

2020-06-16 Thread Amit Khandekar
On Wed, 10 Jun 2020 at 17:12, Pavel Stehule wrote: > st 10. 6. 2020 v 12:26 odesílatel Amit Khandekar > napsal: >> Could you show an example testcase that tests this recursive scenario, >> with which your earlier patch fails the test, and this v2 patch passes >> it ? I am trying to understand th

Re: calling procedures is slow and consumes extra much memory against calling function

2020-06-10 Thread Pavel Stehule
st 10. 6. 2020 v 12:26 odesílatel Amit Khandekar napsal: > On Sat, 16 May 2020 at 00:07, Pavel Stehule > wrote: > > > > Hi > > > >>> > >>> The problem is in plpgsql implementation of CALL statement > >>> > >>> In non atomic case - case of using procedures from DO block, the > expression plan is

Re: calling procedures is slow and consumes extra much memory against calling function

2020-06-10 Thread Amit Khandekar
On Sat, 16 May 2020 at 00:07, Pavel Stehule wrote: > > Hi > >>> >>> The problem is in plpgsql implementation of CALL statement >>> >>> In non atomic case - case of using procedures from DO block, the >>> expression plan is not cached, and plan is generating any time. This is >>> reason why it i

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-16 Thread Ranier Vilela
Em sáb., 16 de mai. de 2020 às 11:07, Pavel Stehule escreveu: > > > so 16. 5. 2020 v 15:24 odesílatel Ranier Vilela > napsal: > >> Em sáb., 16 de mai. de 2020 às 09:35, Pavel Stehule < >> pavel.steh...@gmail.com> escreveu: >> >>> >>> >>> so 16. 5. 2020 v 13:40 odesílatel Ranier Vilela >>> napsa

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-16 Thread Pavel Stehule
so 16. 5. 2020 v 15:24 odesílatel Ranier Vilela napsal: > Em sáb., 16 de mai. de 2020 às 09:35, Pavel Stehule < > pavel.steh...@gmail.com> escreveu: > >> >> >> so 16. 5. 2020 v 13:40 odesílatel Ranier Vilela >> napsal: >> >>> Em sáb., 16 de mai. de 2020 às 01:10, Pavel Stehule < >>> pavel.steh..

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-16 Thread Ranier Vilela
Em sáb., 16 de mai. de 2020 às 09:35, Pavel Stehule escreveu: > > > so 16. 5. 2020 v 13:40 odesílatel Ranier Vilela > napsal: > >> Em sáb., 16 de mai. de 2020 às 01:10, Pavel Stehule < >> pavel.steh...@gmail.com> escreveu: >> >>> >>> >>> so 16. 5. 2020 v 5:55 odesílatel Ranier Vilela >>> napsal

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-16 Thread Pavel Stehule
so 16. 5. 2020 v 13:40 odesílatel Ranier Vilela napsal: > Em sáb., 16 de mai. de 2020 às 01:10, Pavel Stehule < > pavel.steh...@gmail.com> escreveu: > >> >> >> so 16. 5. 2020 v 5:55 odesílatel Ranier Vilela >> napsal: >> >>> Em sáb., 16 de mai. de 2020 às 00:07, Pavel Stehule < >>> pavel.steh...

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-16 Thread Ranier Vilela
Em sáb., 16 de mai. de 2020 às 01:10, Pavel Stehule escreveu: > > > so 16. 5. 2020 v 5:55 odesílatel Ranier Vilela > napsal: > >> Em sáb., 16 de mai. de 2020 às 00:07, Pavel Stehule < >> pavel.steh...@gmail.com> escreveu: >> >>> >>> >>> so 16. 5. 2020 v 0:34 odesílatel Ranier Vilela >>> napsal:

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-15 Thread Pavel Stehule
so 16. 5. 2020 v 5:55 odesílatel Ranier Vilela napsal: > Em sáb., 16 de mai. de 2020 às 00:07, Pavel Stehule < > pavel.steh...@gmail.com> escreveu: > >> >> >> so 16. 5. 2020 v 0:34 odesílatel Ranier Vilela >> napsal: >> >>> Em dom., 10 de mai. de 2020 às 17:21, Pavel Stehule < >>> pavel.steh...@

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-15 Thread Ranier Vilela
Em sáb., 16 de mai. de 2020 às 00:07, Pavel Stehule escreveu: > > > so 16. 5. 2020 v 0:34 odesílatel Ranier Vilela > napsal: > >> Em dom., 10 de mai. de 2020 às 17:21, Pavel Stehule < >> pavel.steh...@gmail.com> escreveu: >> >>> Hi >>> >>> I try to use procedures in Orafce package, and I did som

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-15 Thread Pavel Stehule
so 16. 5. 2020 v 0:34 odesílatel Ranier Vilela napsal: > Em dom., 10 de mai. de 2020 às 17:21, Pavel Stehule < > pavel.steh...@gmail.com> escreveu: > >> Hi >> >> I try to use procedures in Orafce package, and I did some easy >> performance tests. I found some hard problems: >> >> 1. test case >>

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-15 Thread Ranier Vilela
Em dom., 10 de mai. de 2020 às 17:21, Pavel Stehule escreveu: > Hi > > I try to use procedures in Orafce package, and I did some easy performance > tests. I found some hard problems: > > 1. test case > > create or replace procedure p1(inout r int, inout v int) as $$ > begin v := random() * r; end

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-15 Thread Pavel Stehule
Hi > The problem is in plpgsql implementation of CALL statement >> >> In non atomic case - case of using procedures from DO block, the >> expression plan is not cached, and plan is generating any time. This is >> reason why it is slow. >> >> Unfortunately, generated plans are not released until

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-10 Thread Pavel Stehule
po 11. 5. 2020 v 7:25 odesílatel Pavel Stehule napsal: > Hi > > ne 10. 5. 2020 v 22:20 odesílatel Pavel Stehule > napsal: > >> Hi >> >> I try to use procedures in Orafce package, and I did some easy >> performance tests. I found some hard problems: >> >> 1. test case >> >> create or replace proc

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-10 Thread Michael Paquier
On Sun, May 10, 2020 at 10:20:53PM +0200, Pavel Stehule wrote: > When I rewrite same to functions then > > create or replace function p1func2(inout r int, inout v int) as $$ > begin v := random() * r; end > $$ language plpgsql; > > Then execution is about 1 sec, and memory requirements are +/- zero

Re: calling procedures is slow and consumes extra much memory against calling function

2020-05-10 Thread Pavel Stehule
Hi ne 10. 5. 2020 v 22:20 odesílatel Pavel Stehule napsal: > Hi > > I try to use procedures in Orafce package, and I did some easy performance > tests. I found some hard problems: > > 1. test case > > create or replace procedure p1(inout r int, inout v int) as $$ > begin v := random() * r; end >

calling procedures is slow and consumes extra much memory against calling function

2020-05-10 Thread Pavel Stehule
Hi I try to use procedures in Orafce package, and I did some easy performance tests. I found some hard problems: 1. test case create or replace procedure p1(inout r int, inout v int) as $$ begin v := random() * r; end $$ language plpgsql; This command requires do $$ declare r int default 100;