Обсуждение: Does Postgres 14 have a query cache?

Поиск
Список
Период
Сортировка

Does Postgres 14 have a query cache?

От
Siddharth Jain
Дата:
I think the answer is no but wanted to confirm here. this is what my best friend told me.

image.png
Вложения

Re: Does Postgres 14 have a query cache?

От
"David G. Johnston"
Дата:
On Sat, Feb 18, 2023 at 7:47 AM Siddharth Jain <siddhsql@gmail.com> wrote:
I think the answer is no but wanted to confirm here. this is what my best friend told me.

image.png

I find the last paragraph suspect.  The rest is basically correct.

David J.
Вложения

Re: Does Postgres 14 have a query cache?

От
"Peter J. Holzer"
Дата:
On 2023-02-18 06:46:59 -0800, Siddharth Jain wrote:
> I think the answer is no but wanted to confirm here. this is what my best
> friend told me.
>
> image.png

ChatGPT is your best friend?

It is correct. PostgreSQL doesn't have a query cache. I think the reason
is that the use case (the exact same query is submitted repeatedly) is
sufficiently rare that it isn't all that effective in practice.

(The other techniques mentioned are of course also used by other
databases.)

        hp


--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

Re: Does Postgres 14 have a query cache?

От
Christophe Pettus
Дата:

> On Feb 18, 2023, at 06:59, Peter J. Holzer <hjp-pgsql@hjp.at> wrote:
> I think the reason
> is that the use case (the exact same query is submitted repeatedly) is
> sufficiently rare that it isn't all that effective in practice.

And, in this use case, a prepared statement is in effect a cache of the parsing and planning of the query.  Detecting
identicalqueries and caching their results while maintaining good invalidation is a much harder problem. 



Re: Does Postgres 14 have a query cache?

От
Ron
Дата:
It's got buffers.  If you frequently query the same lookup tables, they'll stay in memory...

On 2/18/23 08:46, Siddharth Jain wrote:
I think the answer is no but wanted to confirm here. this is what my best friend told me.

image.png

--
Born in Arizona, moved to Babylonia.
Вложения

Re: Does Postgres 14 have a query cache?

От
Steven Lembark
Дата:
On Sat, 18 Feb 2023 12:43:42 -0600
Ron <ronljohnsonjr@gmail.com> wrote:

> > I think the answer is no but wanted to confirm here. this is what
> > my best friend told me.

There are caches for prepared statements, table rows, indexes. 

What about the caches are you interested in?


-- 
Steven Lembark
Workhorse Computing
lembark@wrkhors.com
+1 888 359 3508



Re: Does Postgres 14 have a query cache?

От
Siddharth Jain
Дата:
Thanks all for the replies. Just wanted to confirm. 

On Sat, Feb 18, 2023 at 10:45 AM Steven Lembark <lembark@wrkhors.com> wrote:
On Sat, 18 Feb 2023 12:43:42 -0600
Ron <ronljohnsonjr@gmail.com> wrote:

> > I think the answer is no but wanted to confirm here. this is what
> > my best friend told me.

There are caches for prepared statements, table rows, indexes.

What about the caches are you interested in?


--
Steven Lembark
Workhorse Computing
lembark@wrkhors.com
+1 888 359 3508


Re: Does Postgres 14 have a query cache?

От
Tatsuo Ishii
Дата:
> On Sat, Feb 18, 2023 at 7:47 AM Siddharth Jain <siddhsql@gmail.com> wrote:
> 
>> I think the answer is no but wanted to confirm here. this is what my best
>> friend told me.
>>
>> [image: image.png]
>>
> 
> I find the last paragraph suspect.  The rest is basically correct.

Yeah. Pgpool-II has query cache but PgBouncer does not.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp