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!
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.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.