Re: Having query cache in core

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Having query cache in core
Date: 2018-05-07 08:12:33
Message-ID: 845e8054-42ae-8e3c-0fbd-dc8c8a85c6be@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07.05.2018 05:32, Tatsuo Ishii wrote:
> Does anybody think having in-memory query result cache in core is a
> good idea? From the experience of implementing the feature in
> Pgpool-II, I would think this is not terribly hard job. But first of
> all I'm wondering if there's a demand for the feature.

Do you want to implement this cache locally in backend?
If so, then I do not think that this cache will be able to demonstrate
some noticeable improvements of performance.
Yes, it is possible to expect that there is some subset of queries which
is used to be execute by application multiple times.
But most likely such query will be issued by different clients. It is
unlikely that the same client will execute the same query (with the same
parameter values)
more than once. Usually clients are using ORM which will in any case
somehow cache fetched data.

Global result cache (like one used in mySQL) may be more efficient.
But I think it is better to start first with
1. Global prepared statements cache
2. Global catalog cache
3. Global relation cache

Switch to global caches seems to be a challenged task, requiring a lot
of changes in Postgres core.
But I think that sometime we will have to implement them in any case (as
it was done in most of other DBMSes).
Concerning result cache, I think it will be better to ask opinion of
mysql users: how useful it is.

--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2018-05-07 08:24:27 RE: Having query cache in core
Previous Message Hartmut Holzgraefe 2018-05-07 08:08:06 Re: Having query cache in core