| ▲ | andrenotgiant 7 hours ago | |
Is there any good reason to use stored procedures in 2026? | ||
| ▲ | scottlamb 6 hours ago | parent [-] | |
I'd think so. Stored procedures let you do multi-statement sequences in fewer round trips. In 2026 larger systems are as likely as ever to run PostgreSQL on a different machine (or machines) than the application server. While latency between the two generally goes down over time, it's still not nothing. You may care about the latency of individual operations or the throughput impact of latency while holding a lock (see Amdahl's law). Of course, the reasons not to use stored procedures still apply. They're logic, but they're versioned with the database schema, not with your application, which can be a pain. | ||