One process per session lack of sharing

From: AMatveev(at)bitec(dot)ru
To: pgsql-hackers(at)postgresql(dot)org
Subject: One process per session lack of sharing
Date: 2016-07-12 13:57:57
Message-ID: 942824238.20160712165757@bitec.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

Is there any plan to implement "session per thread" or "shared
sessions between thread"?
We have analyzed the ability to contribute pgSql to jvm bytecode compiler but with
current thread model this idea is far from optimal.(Vm can be different of course.
But currently we use oracle and jvm is important for us)

We have faced with some lack of sharing resources.
So in our test memory usage per session:
Oracle: about 5M
MSSqlServer: about 4M
postgreSql: about 160М

It's discussed on pgsql-general(at)postgresql(dot)org:
http://www.mail-archive.com/pgsql-general(at)postgresql(dot)org/msg206452.html

>I think the "problem" that he is having is fixable only by changing how
>PostgreSQL itself works. His problem is a PL/pgSQL function which is 11K
>lines in length. When invoked, this function is "compiled" into a large
>tokenized parse tree. This parse tree is only usable in the session which
>invoked the the function. Apparently this parse tree takes a lot of memory.
>And "n" concurrent users of this, highly used, function will therefore
>require "n" times as much memory because the parse tree is _not_
>shareable. This is explained in:
>https://www.postgresql.org/docs/9.5/static/plpgsql-implementation.html#PLPGSQL-PLAN-CACHING

Next interesting answer(from Karl Czajkowski <karlcz(at)isi(dot)edu> in
private):
> But, I search the
> archives of the mailing list, and when others have previously
> suggested such caching or reuse, it was immediately shot down by core
> developers.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-07-12 14:18:54 Re: One process per session lack of sharing
Previous Message thomas.berger 2016-07-12 13:36:38 BUG #14244: wrong suffix for pg_size_pretty()