Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-09-01 Thread Fujii Masao
On 2021/09/02 13:36, Sadhuprasad Patro wrote: Yes this update is fine.. Please commit this patch... Yeah, pushed. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-09-01 Thread Sadhuprasad Patro
On Wed, Sep 1, 2021 at 5:31 PM Fujii Masao wrote: > > > > On 2021/08/24 13:07, Mahendra Singh Thalor wrote: > > Thanks Sadhu for the updated patch. > > > > Patch looks good to me and I don't have any more comments. > > > > I marked this patch as 'ready for committer'. > > https://commitfest.postgr

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-09-01 Thread Fujii Masao
On 2021/08/24 13:07, Mahendra Singh Thalor wrote: Thanks Sadhu for the updated patch. Patch looks good to me and I don't have any more comments. I marked this patch as 'ready for committer'. https://commitfest.postgresql.org/34/3282/ Attached is

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-23 Thread Mahendra Singh Thalor
On Sun, 22 Aug 2021 at 22:53, Sadhuprasad Patro wrote: > > > On 2021/08/20 11:07, Mahendra Singh Thalor wrote: > > > 1) > > > Resets statistics for a single table or index in the current database > > > -to zero. > > > +to zero. The input can be a shared table also > > > >

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-22 Thread Sadhuprasad Patro
> On 2021/08/20 11:07, Mahendra Singh Thalor wrote: > > 1) > > Resets statistics for a single table or index in the current > > database > > -to zero. > > +to zero. The input can be a shared table also > > > > I think, above comment should be modified. Maybe, we can modif

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-22 Thread Sadhuprasad Patro
> 3) > - dbentry = pgstat_get_db_entry(msg->m_databaseid, false); > + if (!IsSharedRelation(msg->m_objectid)) > + dbentry = pgstat_get_db_entry(msg->m_databaseid, false); > + else > + dbentry = pgstat_get_db_entry(InvalidOid, false); > > We should add s

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-19 Thread Fujii Masao
On 2021/08/20 11:07, Mahendra Singh Thalor wrote: 1)          Resets statistics for a single table or index in the current database -        to zero. +        to zero. The input can be a shared table also I think, above comment should be modified. Maybe, we can modify it as "If input is a s

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-19 Thread Mahendra Singh Thalor
On Fri, 20 Aug 2021 at 07:37, Mahendra Singh Thalor wrote: > > On Fri, 20 Aug 2021 at 06:32, Sadhuprasad Patro wrote: > > > > > If we do support resetting the stats for shared tables in > > > 'pg_stat_reset', which is for DB level, > > > then the stats of shared tables will be reseted in other in

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-19 Thread Mahendra Singh Thalor
On Fri, 20 Aug 2021 at 06:32, Sadhuprasad Patro wrote: > > > If we do support resetting the stats for shared tables in > > 'pg_stat_reset', which is for DB level, > > then the stats of shared tables will be reseted in other instances as > > well, which seems to be not correct. > > So we need to pr

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-19 Thread Sadhuprasad Patro
> If we do support resetting the stats for shared tables in > 'pg_stat_reset', which is for DB level, > then the stats of shared tables will be reseted in other instances as > well, which seems to be not correct. > So we need to provide some way to reset the stats for shared tables to > customers.

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-19 Thread Sadhuprasad Patro
On Wed, Aug 11, 2021 at 10:30 AM Mahendra Singh Thalor wrote: > > On Wed, 11 Aug 2021 at 09:17, Dilip Kumar wrote: > > > > On Tue, Aug 10, 2021 at 10:49 PM Mahendra Singh Thalor > > wrote: > > > > > I checked this and found that we already have one process "stats > > > collector" and in v02 patc

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-10 Thread Mahendra Singh Thalor
On Wed, 11 Aug 2021 at 09:17, Dilip Kumar wrote: > > On Tue, Aug 10, 2021 at 10:49 PM Mahendra Singh Thalor > wrote: > > > I checked this and found that we already have one process "stats > > collector" and in v02 patch, we are sending requests to collect stats > > two times. I don't know how cos

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-10 Thread Dilip Kumar
On Tue, Aug 10, 2021 at 10:49 PM Mahendra Singh Thalor wrote: > I checked this and found that we already have one process "stats > collector" and in v02 patch, we are sending requests to collect stats > two times. I don't know how costly one call is but I feel that we can > avoid the 2nd call by

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-10 Thread Mahendra Singh Thalor
On Tue, 10 Aug 2021 at 22:32, Mahendra Singh Thalor wrote: > > On Tue, 10 Aug 2021 at 21:53, Sadhuprasad Patro wrote: > > > > > As of now, we are adding handling inside pg_stat_reset for shared > > > tables but I think we can add a new function with the name of > > > pg_stat_reset_shared_tables t

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-10 Thread Mahendra Singh Thalor
On Tue, 10 Aug 2021 at 21:53, Sadhuprasad Patro wrote: > > > As of now, we are adding handling inside pg_stat_reset for shared > > tables but I think we can add a new function with the name of > > pg_stat_reset_shared_tables to reset stats for all the shared tables. > > New function will give more

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-10 Thread Sadhuprasad Patro
> As of now, we are adding handling inside pg_stat_reset for shared > tables but I think we can add a new function with the name of > pg_stat_reset_shared_tables to reset stats for all the shared tables. > New function will give more clarity to the users also. We already have > a pg_stat_reset_shar

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-10 Thread Sadhuprasad Patro
> 3) I am attaching a .sql file. We can add similar types of test cases for > shared tables. > Ex: first reset stats for all shared tables using pg_stat_reset and then > check stats for all shared tables(all should be zero) Adding a new test case for this looks difficult as results are not consi

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-08 Thread Mahendra Singh Thalor
On Mon, 9 Aug 2021 at 06:56, Sadhuprasad Patro wrote: > > Hi, > > > > 3) > > > pgstat_recv_resetsinglecounter(PgStat_MsgResetsinglecounter *msg, int > > > len) > > > { > > > PgStat_StatDBEntry *dbentry; > > > +boolfound; > > > > > > dbentry = pgstat_get_db_entry(msg->m_dat

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-08 Thread Sadhuprasad Patro
Hi, > > 3) > > pgstat_recv_resetsinglecounter(PgStat_MsgResetsinglecounter *msg, int len) > > { > > PgStat_StatDBEntry *dbentry; > > +boolfound; > > > > dbentry = pgstat_get_db_entry(msg->m_databaseid, false); > > > > @@ -5168,13 +5192,41 @@ > > pgstat_recv_resetsinglecount

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Mahendra Singh Thalor
On Sat, 7 Aug 2021 at 11:49, Mahendra Singh Thalor wrote: > > On Sat, 7 Aug 2021 at 00:13, Mahendra Singh Thalor wrote: > > > > On Fri, 6 Aug 2021 at 21:17, Dilip Kumar wrote: > > > > > > On Fri, Aug 6, 2021 at 8:53 PM Himanshu Upadhyaya > > > wrote: > > > > > > > > Hi Sadhu, > > > > > > > > Pa

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Mahendra Singh Thalor
On Sat, 7 Aug 2021 at 00:13, Mahendra Singh Thalor wrote: > > On Fri, 6 Aug 2021 at 21:17, Dilip Kumar wrote: > > > > On Fri, Aug 6, 2021 at 8:53 PM Himanshu Upadhyaya > > wrote: > > > > > > Hi Sadhu, > > > > > > Patch working as expected with shared tables, just one Minor comment on the patch.

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Mahendra Singh Thalor
On Fri, 6 Aug 2021 at 21:17, Dilip Kumar wrote: > > On Fri, Aug 6, 2021 at 8:53 PM Himanshu Upadhyaya > wrote: > > > > Hi Sadhu, > > > > Patch working as expected with shared tables, just one Minor comment on the > > patch. > > + if (!dbentry) > > + return; > > + > > +

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Dilip Kumar
On Fri, Aug 6, 2021 at 8:53 PM Himanshu Upadhyaya wrote: > > Hi Sadhu, > > Patch working as expected with shared tables, just one Minor comment on the > patch. > + if (!dbentry) > + return; > + > + /* > +* We simply throw away all the shared table entries by recr

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Himanshu Upadhyaya
Hi Sadhu, Patch working as expected with shared tables, just one Minor comment on the patch. + if (!dbentry) + return; + + /* +* We simply throw away all the shared table entries by recreating new +* hash table for them. +*/ + if (dbentry->ta

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Mahendra Singh Thalor
On Fri, 6 Aug 2021 at 17:40, Himanshu Upadhyaya wrote: > > Hi Sadhu, > > > > The call to “pg_stat_reset“ does reset all the statistics data for > > tables belonging to the current database but does not take care of > > shared tables e.g pg_attribute. > > pg_attribute is not a shared catalog, is th

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Himanshu Upadhyaya
Hi Sadhu, > The call to “pg_stat_reset“ does reset all the statistics data for > tables belonging to the current database but does not take care of > shared tables e.g pg_attribute. pg_attribute is not a shared catalog, is the mentioned scenario is also applicable for few others tables? I have

Re: Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Mahendra Singh Thalor
On Fri, 6 Aug 2021 at 13:56, Sadhuprasad Patro wrote: > > Hi, > > The call to “pg_stat_reset“ does reset all the statistics data for > tables belonging to the current database but does not take care of > shared tables e.g pg_attribute. Similarly to reset the statistics at > table level, the call t

Support reset of Shared objects statistics in "pg_stat_reset" function

2021-08-06 Thread Sadhuprasad Patro
Hi, The call to “pg_stat_reset“ does reset all the statistics data for tables belonging to the current database but does not take care of shared tables e.g pg_attribute. Similarly to reset the statistics at table level, the call to “pg_stat_reset_single_table_counters“ does not take care of shared