Re: Function's execute overhead reducing

2019-11-17 Thread Игорь Выскорко
> My suspicion is that the query in the function is hidden from the > planner and so it ends up running two separate SELECT queries without > reference to each other. A quick test and possible solution: > > My results for the above on old machine.: > > Straight query: >

Re: Function's execute overhead reducing

2019-11-17 Thread Adrian Klaver
On 11/16/19 11:23 PM, Игорь Выскорко wrote: Hi all! The best way to describe my question is to show the code as first: create table tst( id int primary key, j1 jsonb, j2 jsonb ); insert into tst select ser, jsonb_build_object( floor(random() * 10 + 1), floor(random() * 1000