News for hackers. Stuff that matters.
Re:Let Postgres Do the Work (2013) by grzm on Saturday November 26, 2016 @04:38PM (#13046023)
One performance benefit of stored procedures in Postgres is that you can perform a multi-statement transaction in the stored procedure, saving the network overhead of multiple round-trips between the application and the database. This may not be a common occurrence for many applications, but it is a legitimate performance benefit when the need arises.
Re:Let Postgres Do the Work (2013) by anarazel on Saturday November 26, 2016 @04:57PM (#13046119)
Note that the network protocol allows pipelining for multiple statements (including transaction control ones), too. Unfortunately only few client libraries (e.g. pgjdbc) make use of that :(
Re:Let Postgres Do the Work (2013) by azernik on Saturday November 26, 2016 @05:16PM (#13046221)
I don't know about Rails and ActiveRecord, but I can do this in Slick.
Re:Let Postgres Do the Work (2013) by kofejnik on Saturday November 26, 2016 @08:09PM (#13047100)
you can do multi-statement and nested transactions even in Rails