On 15 July 2016 at 18:05, Pavel Stehule <pavel.steh...@gmail.com> wrote:


> There is only few use cases - mostly related to Oracle emulation when
> multi threading is necessary - and few can be solved better - PLpgSQL to C
> compilation and similar techniques.
>
>
Right.

If amatveev (username, unsure of full name) wants to improve PL/PgSQL
performance and the ability of a JVM to share resources between backends,
then it would be more productive to focus on that than on threading.

As for "fixing" the FAQ... for the great majority of people the FAQ entry
on memory use is accurate. Sure, if you load a JVM into each backend and
load a bunch of cached data in it, you'll get bad memory use. So don't do
that. You're not measuring PostgreSQL, you're measuring
PostgreSQL-plus-my-JVM-extension. Why does it use so much memory? 'cos it
loads a whole bunch of stuff into each backend.

Now, there are other cases where individual PostgreSQL backends use lots of
memory. But that FAQ entry refers to the common misconception that each
PostgreSQL process's reported memory use is the actual system memory it
uses. That isn't the case because most systems account badly for shared
memory, and it confuses a lot of people. The FAQ entry doesn't need fixing.

Maybe the FAQ entry needs rewording to qualify it so it says that "in most
cases" it's just shared memory mis-accounting. But that's about it.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Reply via email to