The correct choice depends on what exactly you're going to do.
In my experience, pl/pgsql has less overhead than say pl/perl, pl/python or pl/tcl, if what you want to do is easily expressde in pl/pgsql. For example, if you're doing database operations. However, the overhead you pay for example for pl/perl quickly comes back if you do something that perl is good at - such as for example string processing.
The one thing you have to think of in those cases are that the "bigger" languages like perl and python have a significantly higher startup cost than pl/pgsql - but that can easily be mitigated by using persistent connections.
Functions written in C will almost certainly be faster - and they'll use less memory if you can write code that is good at using little memory. However, the overheard of writing and maintaining them is usually a lot worse than the PLs - in particularly constructing and deconstructing tuples will take a lot more code than you think in any kind of complex functions.








Reply With Quote