Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2025-01-07 Thread Bertrand Drouvot
Hi, On Tue, Jan 07, 2025 at 10:19:36PM +0100, Tomas Vondra wrote: > On 1/7/25 21:42, Robert Treat wrote: > > On Tue, Jan 7, 2025 at 10:44 AM Bertrand Drouvot > > wrote: > >> > >> ... > >> > >> Another idea regarding the storage of those metrics: I think that one would > >> want to see "precise" d

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2025-01-07 Thread Tomas Vondra
On 1/7/25 21:42, Robert Treat wrote: > On Tue, Jan 7, 2025 at 10:44 AM Bertrand Drouvot > wrote: >> >> ... >> >> Another idea regarding the storage of those metrics: I think that one would >> want to see "precise" data for recent metrics but would probably be fine >> with some >> level of aggrega

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2025-01-07 Thread Robert Treat
On Tue, Jan 7, 2025 at 10:44 AM Bertrand Drouvot wrote: > > Hi, > > On Wed, Dec 25, 2024 at 06:25:50PM +0100, Tomas Vondra wrote: > > Hi, > > > > On 12/23/24 07:35, wenhui qiu wrote: > > > Hi Tomas > > > This is a great feature. > > > + /* > > > + * Define (or redefine) custom GUC variables.

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2025-01-07 Thread Bertrand Drouvot
Hi, On Wed, Dec 25, 2024 at 06:25:50PM +0100, Tomas Vondra wrote: > Hi, > > On 12/23/24 07:35, wenhui qiu wrote: > > Hi Tomas  > >      This is a great feature.   > > + /* > > + * Define (or redefine) custom GUC variables. > > + */ > > + DefineCustomIntVariable("stats_history.size", > > + "Sets t

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2025-01-07 Thread Cédric Villemain
On 31/12/2024 16:06, Tomas Vondra wrote: On 12/31/24 02:06, Michael Paquier wrote: On Sat, Dec 28, 2024 at 02:25:16AM +0100, Tomas Vondra wrote: And the more I think about it the more I'm convinced we don't need to keep the data about past runs in memory, a file should be enough (except maybe

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-31 Thread Jim Nasby
On Dec 31, 2024, at 9:20 AM, Tomas Vondra wrote: > >> Speaking of retention, it would be nice if this feature allowed users to >> DELETE from the view that presented the data. That would allow for any >> kind of custom config that someone could dream up. > > I really don't intend / want to do th

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-31 Thread Tomas Vondra
On 12/30/24 22:40, Jim Nasby wrote: > On Dec 25, 2024, at 11:25 AM, Tomas Vondra wrote: >> But maybe it'd be possible to just write the entries to a file. We don't >> need random access to past entries (unlike e.g. pg_stat_statements), and >> people won't query that very often either. > > Assumin

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-31 Thread Tomas Vondra
On 12/31/24 02:06, Michael Paquier wrote: > On Sat, Dec 28, 2024 at 02:25:16AM +0100, Tomas Vondra wrote: >> And the more I think about it the more I'm convinced we don't need to >> keep the data about past runs in memory, a file should be enough (except >> maybe for a small buffer). That would mea

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-30 Thread Michael Paquier
On Sat, Dec 28, 2024 at 02:25:16AM +0100, Tomas Vondra wrote: > And the more I think about it the more I'm convinced we don't need to > keep the data about past runs in memory, a file should be enough (except > maybe for a small buffer). That would mean we don't need to worry about > dynamic shared

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-30 Thread Jim Nasby
On Dec 25, 2024, at 11:25 AM, Tomas Vondra wrote: > But maybe it'd be possible to just write the entries to a file. We don't > need random access to past entries (unlike e.g. pg_stat_statements), and > people won't query that very often either. Assuming this doesn’t add significant complexity I t

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-29 Thread Tomas Vondra
On 12/29/24 16:39, Robert Treat wrote: > On Fri, Dec 27, 2024 at 8:25 PM Tomas Vondra wrote: >> On 12/27/24 05:00, Michael Paquier wrote: >>> On Thu, Dec 26, 2024 at 06:58:11PM +0100, Tomas Vondra wrote: If 128MB is insufficient, why would 256MB be OK? A factor of 2x does not make a fund

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-29 Thread Robert Treat
On Fri, Dec 27, 2024 at 8:25 PM Tomas Vondra wrote: > On 12/27/24 05:00, Michael Paquier wrote: > > On Thu, Dec 26, 2024 at 06:58:11PM +0100, Tomas Vondra wrote: > >> If 128MB is insufficient, why would 256MB be OK? A factor of 2x does not > >> make a fundamental difference ... > >> > >> Anyway, t

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-27 Thread Tomas Vondra
On 12/27/24 05:00, Michael Paquier wrote: > On Thu, Dec 26, 2024 at 06:58:11PM +0100, Tomas Vondra wrote: >> If 128MB is insufficient, why would 256MB be OK? A factor of 2x does not >> make a fundamental difference ... >> >> Anyway, the 128MB value is rather arbitrary. I don't mind increasing th

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-26 Thread Michael Paquier
On Thu, Dec 26, 2024 at 06:58:11PM +0100, Tomas Vondra wrote: > If 128MB is insufficient, why would 256MB be OK? A factor of 2x does not > make a fundamental difference ... > > Anyway, the 128MB value is rather arbitrary. I don't mind increasing the > limit, or possibly removing it entirely (and a

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-26 Thread wenhui qiu
Hi Tomas > If 128MB is insufficient, why would 256MB be OK? A factor of 2x does not > make a fundamental difference ... agree > Anyway, the 128MB value is rather arbitrary. I don't mind increasing the > limit, or possibly removing it entirely (and accepting anything the > system can handle). yes,

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-26 Thread Tomas Vondra
On 12/26/24 17:00, wenhui qiu wrote: > Hi  >     > As far as I know, more than 10,000 tables  of instances  are often > encountered, > So I insist that the maximum can be appropriately increased to 256MB, > Can be more adaptable to many table situations > If 128MB is insufficient, why would 256MB

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-26 Thread wenhui qiu
Hi As far as I know, more than 10,000 tables of instances are often encountered, So I insist that the maximum can be appropriately increased to 256MB,Can be more adaptable to many table situations On Thu, 26 Dec 2024 at 23:23, Robert Treat wrote: > On Wed, Dec 25, 2024 at 12:26 PM Tomas Vondr

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-26 Thread Robert Treat
On Wed, Dec 25, 2024 at 12:26 PM Tomas Vondra wrote: > > Hi, > > On 12/23/24 07:35, wenhui qiu wrote: > > Hi Tomas > > This is a great feature. > > + /* > > + * Define (or redefine) custom GUC variables. > > + */ > > + DefineCustomIntVariable("stats_history.size", > > + "Sets the amount of me

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-25 Thread Tomas Vondra
Hi, On 12/23/24 07:35, wenhui qiu wrote: > Hi Tomas  >      This is a great feature.   > + /* > + * Define (or redefine) custom GUC variables. > + */ > + DefineCustomIntVariable("stats_history.size", > + "Sets the amount of memory available for past events.", > + NULL, > + &statsHistorySizeMB, > +

Re: PoC: history of recent vacuum/checkpoint runs (using new hooks)

2024-12-22 Thread wenhui qiu
Hi Tomas This is a great feature. + /* + * Define (or redefine) custom GUC variables. + */ + DefineCustomIntVariable("stats_history.size", + "Sets the amount of memory available for past events.", + NULL, + &statsHistorySizeMB, + 1, + 1, + 128, + PGC_POSTMASTER, + GUC_UNIT_MB, + NULL, + NULL,