Re: Split index and table statistics into different types of stats

2024-01-25 Thread Bertrand Drouvot
Hi, On Tue, Nov 14, 2023 at 09:04:03AM +0100, Drouvot, Bertrand wrote: > On 11/13/23 9:44 PM, Andres Freund wrote: > > Hi, > > > > It's not nice from a layering POV that we need this level of awareness in > > bufmgr.c. I wonder if this is an argument for first splitting out stats > > like > >

Re: Split index and table statistics into different types of stats

2023-11-14 Thread Drouvot, Bertrand
Hi, On 11/13/23 9:44 PM, Andres Freund wrote: Hi, On 2023-11-13 09:26:56 +0100, Drouvot, Bertrand wrote: --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -799,11 +799,19 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, BlockNumber blockNum,

Re: Split index and table statistics into different types of stats

2023-11-13 Thread Andres Freund
Hi, On 2023-11-13 09:26:56 +0100, Drouvot, Bertrand wrote: > --- a/src/backend/storage/buffer/bufmgr.c > +++ b/src/backend/storage/buffer/bufmgr.c > @@ -799,11 +799,19 @@ ReadBufferExtended(Relation reln, ForkNumber forkNum, > BlockNumber blockNum, >* Read the buffer, and update pgstat

Re: Split index and table statistics into different types of stats

2023-08-04 Thread Drouvot, Bertrand
Hi, On 7/10/23 11:14 AM, Daniel Gustafsson wrote: On 4 Apr 2023, at 12:04, Drouvot, Bertrand wrote: On 4/3/23 11:47 PM, Gregory Stark (as CFM) wrote: On Thu, 16 Mar 2023 at 05:25, Drouvot, Bertrand wrote: My plan was to get [1] done before resuming working on the "Split index and table

Re: Split index and table statistics into different types of stats

2023-07-10 Thread Daniel Gustafsson
> On 4 Apr 2023, at 12:04, Drouvot, Bertrand > wrote: > On 4/3/23 11:47 PM, Gregory Stark (as CFM) wrote: >> On Thu, 16 Mar 2023 at 05:25, Drouvot, Bertrand >> wrote: >>> >>> My plan was to get [1] done before resuming working on the "Split index and >>> table statistics into different types

Re: Split index and table statistics into different types of stats

2023-04-04 Thread Michael Paquier
On Tue, Apr 04, 2023 at 12:04:35PM +0200, Drouvot, Bertrand wrote: > I moved it to the next commitfest and marked the target version as > v17. Thanks for moving it. I think that we should be able to do a bit more work for the switch to macros in pgstatfuncs.c, but this is going to require more

Re: Split index and table statistics into different types of stats

2023-04-04 Thread Drouvot, Bertrand
Hi, On 4/3/23 11:47 PM, Gregory Stark (as CFM) wrote: On Thu, 16 Mar 2023 at 05:25, Drouvot, Bertrand wrote: My plan was to get [1] done before resuming working on the "Split index and table statistics into different types of stats" one. [1]: https://commitfest.postgresql.org/42/4106/

Re: Split index and table statistics into different types of stats

2023-04-03 Thread Gregory Stark (as CFM)
On Thu, 16 Mar 2023 at 05:25, Drouvot, Bertrand wrote: > > My plan was to get [1] done before resuming working on the "Split index and > table statistics into different types of stats" one. > [1]: https://commitfest.postgresql.org/42/4106/ Generate pg_stat_get_xact*() functions with Macros

Re: Split index and table statistics into different types of stats

2023-03-16 Thread Michael Paquier
On Thu, Mar 16, 2023 at 10:24:32AM +0100, Drouvot, Bertrand wrote: > My plan was to get [1] done before resuming working on the "Split > index and table statistics into different types of stats" one. Okay, I was unsure what should be the order here. Let's see about [1] first, then. -- Michael

Re: Split index and table statistics into different types of stats

2023-03-16 Thread Michael Paquier
On Sat, Jan 21, 2023 at 06:42:51AM +0100, Drouvot, Bertrand wrote: > Please find attached a rebased version (previous comments > up-thread still need to be addressed though). This patch has a lot of conflicts. Could you send a rebased version? -- Michael signature.asc Description: PGP

Re: Split index and table statistics into different types of stats

2023-01-19 Thread vignesh C
On Tue, 3 Jan 2023 at 19:49, Drouvot, Bertrand wrote: > > Hi, > > On 12/10/22 10:54 AM, Drouvot, Bertrand wrote: > > Hi, > > > > On 12/7/22 11:11 AM, Drouvot, Bertrand wrote: > >> Hi, > >> > >>> Hi, > >>> > >>> As [1] mentioned above has been committed (83a1a1b566), please find > >>> attached V5

Re: Split index and table statistics into different types of stats

2023-01-09 Thread Andres Freund
Hi, On 2023-01-09 17:08:42 +0530, Nitin Jadhav wrote: > +1 to keep common functions/code between table and index stats. Only > the data structure should be different as the goal is to shrink the > current memory usage. I don't think the goal is solely to shrink memory usage - it's also to make

Re: Split index and table statistics into different types of stats

2023-01-09 Thread Nitin Jadhav
>> +/* - >> + * >> + * pgstat_index.c >> + *Implementation of index statistics. > > This is a fair bit of duplicated code. Perhaps it'd be worth keeping > pgstat_relation with code common to table/index stats? +1 to keep

Re: Split index and table statistics into different types of stats

2023-01-05 Thread Drouvot, Bertrand
Hi, On 1/5/23 1:27 AM, Andres Freund wrote: Hi, On 2023-01-03 15:19:18 +0100, Drouvot, Bertrand wrote: diff --git a/src/backend/access/common/relation.c b/src/backend/access/common/relation.c index 4017e175e3..fca166a063 100644 --- a/src/backend/access/common/relation.c +++

Re: Split index and table statistics into different types of stats

2023-01-04 Thread Andres Freund
Hi, On 2023-01-03 15:19:18 +0100, Drouvot, Bertrand wrote: > diff --git a/src/backend/access/common/relation.c > b/src/backend/access/common/relation.c > index 4017e175e3..fca166a063 100644 > --- a/src/backend/access/common/relation.c > +++ b/src/backend/access/common/relation.c > @@ -73,7

Re: Split index and table statistics into different types of stats

2022-11-21 Thread Drouvot, Bertrand
Hi, On 11/22/22 7:19 AM, Bharath Rupireddy wrote: On Mon, Nov 21, 2022 at 7:03 PM Drouvot, Bertrand wrote: On 11/21/22 12:19 AM, Andres Freund wrote: That's better, but still seems like quite a bit of repetition, given the number of accessors. I think I like my idea of a macro defining the

Re: Split index and table statistics into different types of stats

2022-11-21 Thread Bharath Rupireddy
On Mon, Nov 21, 2022 at 7:03 PM Drouvot, Bertrand wrote: > > On 11/21/22 12:19 AM, Andres Freund wrote: > > > > That's better, but still seems like quite a bit of repetition, given the > > number of accessors. I think I like my idea of a macro defining the whole > > function a bit better. > > > >

Re: Split index and table statistics into different types of stats

2022-11-21 Thread Drouvot, Bertrand
Hi, On 11/21/22 12:19 AM, Andres Freund wrote: Hi, On 2022-11-18 12:18:38 +0100, Drouvot, Bertrand wrote: On 11/16/22 9:12 PM, Andres Freund wrote: This still leaves a fair bit of boilerplate. ISTM that the function body really should just be a single line. Might even be worth defining the

Re: Split index and table statistics into different types of stats

2022-11-20 Thread Andres Freund
Hi, On 2022-11-18 12:18:38 +0100, Drouvot, Bertrand wrote: > On 11/16/22 9:12 PM, Andres Freund wrote: > > This still leaves a fair bit of boilerplate. ISTM that the function body > > really should just be a single line. > > > > Might even be worth defining the whole function via a macro.

Re: Split index and table statistics into different types of stats

2022-11-18 Thread Drouvot, Bertrand
Hi, On 11/16/22 9:12 PM, Andres Freund wrote: Hi, On 2022-11-15 10:48:40 +0100, Drouvot, Bertrand wrote: diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index ae3365d917..be7f175bf1 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++

Re: Split index and table statistics into different types of stats

2022-11-16 Thread Andres Freund
Hi, On 2022-11-15 10:48:40 +0100, Drouvot, Bertrand wrote: > diff --git a/src/backend/utils/adt/pgstatfuncs.c > b/src/backend/utils/adt/pgstatfuncs.c > index ae3365d917..be7f175bf1 100644 > --- a/src/backend/utils/adt/pgstatfuncs.c > +++ b/src/backend/utils/adt/pgstatfuncs.c > @@ -36,24 +36,34

Re: Split index and table statistics into different types of stats

2022-11-14 Thread Drouvot, Bertrand
Hi, On 11/4/22 9:51 PM, Melanie Plageman wrote: Hi Bertrand, I'm glad you are working on this. I had a few thoughts/ideas Thanks for looking at it! It seems better to have all of the counts in the various stats structs not be prefixed with n_, i_, t_ typedef struct PgStat_StatDBEntry {

Re: Split index and table statistics into different types of stats

2022-11-02 Thread Drouvot, Bertrand
Hi, On 11/1/22 1:30 AM, Andres Freund wrote: Hi, On 2022-10-31 14:14:15 +0100, Drouvot, Bertrand wrote: Please find attached a patch proposal to split index and table statistics into different types of stats. This idea has been proposed by Andres in a couple of threads, see [1] and [2].

Re: Split index and table statistics into different types of stats

2022-10-31 Thread Andres Freund
Hi, On 2022-10-31 14:14:15 +0100, Drouvot, Bertrand wrote: > Please find attached a patch proposal to split index and table statistics > into different types of stats. > > This idea has been proposed by Andres in a couple of threads, see [1] and > [2]. Thanks for working on this! > diff

Re: Split index and table statistics into different types of stats

2022-10-31 Thread Drouvot, Bertrand
Hi, On 10/31/22 2:31 PM, Justin Pryzby wrote: I didn't looks closely, but there's a couple places where you wrote ";;", which looks unintentional. - PG_RETURN_TIMESTAMPTZ(tabentry->lastscan); + PG_RETURN_TIMESTAMPTZ(tabentry->lastscan);; Thanks for looking at it!

Split index and table statistics into different types of stats

2022-10-31 Thread Drouvot, Bertrand
Hi hackers, Please find attached a patch proposal to split index and table statistics into different types of stats. This idea has been proposed by Andres in a couple of threads, see [1] and [2]. To sum up: We currently track index and table types of statistics in the same format (so