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

From tsunakawa.takay@fujitsu.com
Subject RE: Schema variables - new implementation for Postgres 15
Date
Msg-id TYAPR01MB299061DBBFF5C2EBBD307F7FFE4D9@TYAPR01MB2990.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Schema variables - new implementation for Postgres 15  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Schema variables - new implementation for Postgres 15
List pgsql-hackers

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?

 

 

Regards

Takayuki Tsunakawa

 

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Commit ab596105b55 - BRIN minmax-multi indexes
Next
From: Pavel Stehule
Date:
Subject: Re: Schema variables - new implementation for Postgres 15