procedure using CURSOR to insert is extremely slow

2021-04-08 Thread Szalontai Zoltán
Hi, We have a Class db.t2.medium database on AWS. We use a procedure to transfer data records from the Source to the Target Schema. Transfers are identified by the log_id field in the target table. The procedure is: 1 all records are deleted from the Target table with the actual log_id v

RE: procedure using CURSOR to insert is extremely slow

2021-04-08 Thread Szalontai Zoltán
How to check execution plans? We are in the Loop of the Cursor, and we do insert operations in it. From: Hervé Schweitzer (HER) Sent: Thursday, April 8, 2021 1:40 PM To: Szalontai Zoltán ; pgsql-performance@lists.postgresql.org Subject: Re: procedure using CURSOR to insert is extremely slow

RE: procedure using CURSOR to insert is extremely slow

2021-04-08 Thread Szalontai Zoltán
Hi Milos, Inside the loops there are frequently if / else branches value transformations used. We could not solve it without using a cursor. Regards, Zoltán From: Milos Babic Sent: Thursday, April 8, 2021 2:31 PM To: Szalontai Zoltán Cc: Pgsql Performance Subject: Re: procedure

RE: procedure using CURSOR to insert is extremely slow

2021-04-08 Thread Szalontai Zoltán
Hi Milos, I discuss this kind of rethinking with the team. Perhaps I can copy our database on AWS for you, and you can check it. thanks, Zoltán From: Milos Babic Sent: Thursday, April 8, 2021 8:22 PM To: Szalontai Zoltán Cc: Pgsql Performance Subject: Re: procedure using