I would like to know will my performance of my SP’s written in postgresql is going to improve if I move my insert and update statement to the merge statement or it will hamper the performance.
Also if you can provide any official/trustworthy link on the same would be really appreciable.
Just FYI, I am using Postgresql in AWS Aurora Serverless.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
The main benefit of using a MERGE statement is that it offers some convenience over the traditional INSERT and UPDATE statements as you don’t have to worry about transactions with error handling.
However, if you are mainly after performance, then it is best to stick to INSERT and UPDATE statements.
Of course, it is best to test this for your application-specific needs and figure out how it affects your queries that might be specific to your application and data.
Hope that this helps!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.
