Re: Schema variables - new implementation for Postgres 15 - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Schema variables - new implementation for Postgres 15
Date
Msg-id CAFj8pRCvBjJHCndafacvcfif-sFKEO40gQf=souNS+pbho7eJw@mail.gmail.com
Whole thread Raw
In response to RE: Schema variables - new implementation for Postgres 15  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
List pgsql-hackers


čt 15. 4. 2021 v 18:02 odesílatel tsunakawa.takay@fujitsu.com <tsunakawa.takay@fujitsu.com> napsal:

From: Pavel Stehule <pavel.stehule@gmail.com>

--------------------------------------------------

do $$

declare x int ;

begin

  for i in 1..1000000

  loop

    let ooo = i;

  end loop;

end;

$$;

 

variant 1 .. 1500 ms

variant 2 with PLpgSQL support .. 140 ms

variant 2 without PLpgSQL support 9000 ms

--------------------------------------------------

 

 

That's impressive!  But 1 million times of variable assignment took only 140 ms?  It's that one assignment took only 140 nanosecond, which is near one DRAM access?  Can PL/pgSQL processing be really so fast?


In this case the PLpgSQL can be very fast - and after changes in pg 13, the PLpgSQL is not significantly slower than Lua or than PHP.

Every body can repeat these tests - I did it on my Lenovo T520 notebook

Pavel


 

 

Regards

Takayuki Tsunakawa

 

pgsql-hackers by date:

Previous
From: "tsunakawa.takay@fujitsu.com"
Date:
Subject: RE: Schema variables - new implementation for Postgres 15
Next
From: Honza Horak
Date:
Subject: Re: Options given both on cmd-line and in the config with different values