3 ms·
Usually I shy away from such kind of extensions, because DBAs don't like to have them around, and stored procedures are anyway type safe and JIT compiled. Anyw
by pjmlp 2y ago
Usually I shy away from such kind of extensions, because DBAs don't like to have them around, and stored procedures are anyway type safe and JIT compiled.
Anyway, kudos for making it available.
- forinti 2y agoI administer a few Postgresql databases and some extensions are really important for us. Foreign Data Tables, for instance, are great for interconnecting with other databases. I've also heavily used Java stored procs before. Postgresql extensions are great in that you can compile them and link them into a running database.
- pjmlp 2y agoUsually compiling and linking extensions is a basic feature from enterprise level RDMS, PosgreSQL is only doing what is already expected.
- dijit 2y agoUpvoting because its actually good advice (and someone has flagged it for some reason). Engineering is tradeoffs, the limiting factor in most databases is I/O; if you can shift your I/O around to do less of it with a stored procedure then you should probably do it, and having a breakout from SQL on the database itself can achieve that. The reason it scares DBAs is because while I/O is the primary constraint on a DB, everything else is also in finite supply, and people tend to forget how centralised and repeated a stored procedure can become. Especially if its on the hotpath. Developers have a habit of using stored procedures to make their application code easier to reason about rather than trying to minimise disk access. YMMV as with everything, but its a really nice capability to use rust for this, for the execution performance, quick start time and type safety.
- pjmlp 2y agoWhich is why, when we're talking about heavy weights in the RDMS space, all provide tooling for debugging and optimising stored procedures. Thanks for the upvoting.
- p_l 2y agoas much as I dislike (understatement) Oracle my few encounters with it not only showed ability to provide an "API" through SQL to client apps, there was also apparently quite capable JVM inside. Really complex things could be delivered, main issue was always tradeoffs of Oracle itself (portability of Oracle vs Performance loss compared to more native systems) and licensing.
- LunaSea 2y agoSQL and pgplsql triggers for example are usually slower than their JavaScript counterpart.
- pjmlp 2y agoMaybe that is a PostgreSQL issue, or maybe it was a skill issue. Cannot tell, I am more of an Oracle and SQL Server kid of person when it comes to deep RDMS knowledge.