Re: json_to_recordset() and CTE performance

2020-10-21 Thread Matt DeLuco
PostgreSQL 13.0. You’d have to be specific about the configs you’re looking for, I’m using Postgres.app (postgresapp.com ) and am uncertain if it’s distributed with non-default configs. But, a quick grep shows these items that are configured: max_wal_size = 1GB min_wal_

Re: json_to_recordset() and CTE performance

2020-10-21 Thread Michael Lewis
Version? What is the value for work_mem and other configs that are non-default? I see some estimates that are rather off like - -> Nested Loop (cost=0.26..4.76 rows=100 width=148) (actual time=183.906..388716.550 rows=8935 loops=1) Buffers: shared hit=53877 dirtied=

json_to_recordset() and CTE performance

2020-10-21 Thread Matt DeLuco
Hello, I’ve written an sql function that takes a single JSON parameter, in this case an array of objects each with eight properties (example below.) This function uses json_to_recordset() in a CTE to insert three rows on two tables. It takes nearly 7 minutes to insert my dataset of 8935 records