Re: Dynamic gathering the values for seq_page_cost/xxx_cost

From: Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com>
To: Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Dynamic gathering the values for seq_page_cost/xxx_cost
Date: 2020-09-26 07:06:17
Message-ID: CAKU4AWoGMQWa0x6uJkrK763mFXex1vgMJv8XvdTHhfVw7zTOYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 26, 2020 at 1:51 PM Julien Rouhaud <rjuju123(at)gmail(dot)com> wrote:

> On Sat, Sep 26, 2020 at 8:17 AM Andy Fan <zhihui(dot)fan1213(at)gmail(dot)com> wrote:
> >
> > As for the testing with cache considered, I found how to estimate cache
> hit
> > ratio is hard or how to control a hit ratio to test is hard. Recently I
> am thinking
> > a method that we can get a page_reads, shared_buffer_hit from pg_kernel
> > and the real io (without the file system cache hit) at os level (just as
> what
> > iotop/pidstat do). then we can know the shared_buffer hit ratio and file
> system
> > cache hit ratio (assume it will be stable after a long run). and then do
> a testing.
> > However this would be another branch of manual work and I still have not
> got
> > it done until now.
>
> FWIW pg_stat_kcache [1] extension accumulates per (database, user,
> queryid) physical reads and writes, so you can easily compute a
> shared_buffers / IO cache / disk hit ratio.
>
> [1] https://github.com/powa-team/pg_stat_kcache
>

WOW, this would be a good extension for this purpose. Thanks for sharing
it.

--
Best Regards
Andy Fan

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2020-09-26 07:37:49 Re: Display individual query in pg_stat_activity
Previous Message Amit Kapila 2020-09-26 06:37:13 Re: Parallel INSERT (INTO ... SELECT ...)