Re: Performance of JSON_TABLE vs jsonb_to_recordset

2024-04-20 Thread Tom Lane
Alexander Lakhin writes: > explain (verbose, analyze) > select >(select max((select i.unique2 from jsontable_tenk1 i where i.unique1 = > o.unique1))) > from jsontable_tenk1 o; > -- Table Function Call: JSON_TABLE... > Execution Time: 288310.131 ms > (with 63% of time spent inside

Re: Performance of JSON_TABLE vs jsonb_to_recordset

2024-04-20 Thread Tom Lane
I wrote: > Alexander Lakhin writes: >> explain (verbose, analyze) >> select >>   (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1))) >> from tenk1 o; >> -- original tenk1 >>  Execution Time: 4769.481 ms > Hm, I get about 13 ms for that example. Do you have some really >

Re: Performance of JSON_TABLE vs jsonb_to_recordset

2024-04-20 Thread Tom Lane
Alexander Lakhin writes: > When playing with JSON_TABLE, I tried to replace tenk1 in regression tests > with a view based on JSON_TABLE, with the same content, and discovered > that for one sub-optimal query it's execution duration increased many-fold. > With the preparation script attached, I

Performance of JSON_TABLE vs jsonb_to_recordset

2024-04-20 Thread Alexander Lakhin
Hello hackers, When playing with JSON_TABLE, I tried to replace tenk1 in regression tests with a view based on JSON_TABLE, with the same content, and discovered that for one sub-optimal query it's execution duration increased many-fold. With the preparation script attached, I see the following