Re: WAL usage calculation patch

2020-05-06 Thread Amit Kapila
On Wed, May 6, 2020 at 12:19 AM Julien Rouhaud wrote: > > On Tue, May 5, 2020 at 12:44 PM Amit Kapila wrote: > > > > > > > > > > Your patch looks mostly good to me. I have made slight modifications > > > > which include changing the non-text format in show_wal_usage to use a > > > > capital

Re: WAL usage calculation patch

2020-05-05 Thread Julien Rouhaud
On Tue, May 5, 2020 at 12:44 PM Amit Kapila wrote: > > On Mon, May 4, 2020 at 8:03 PM Julien Rouhaud wrote: > > > > On Mon, May 4, 2020 at 6:10 AM Amit Kapila wrote: > > > > > > On Thu, Apr 30, 2020 at 2:19 PM Julien Rouhaud wrote: > > > > > > > > Here's the patch. I included the content of >

Re: WAL usage calculation patch

2020-05-05 Thread Amit Kapila
On Mon, May 4, 2020 at 8:03 PM Julien Rouhaud wrote: > > On Mon, May 4, 2020 at 6:10 AM Amit Kapila wrote: > > > > On Thu, Apr 30, 2020 at 2:19 PM Julien Rouhaud wrote: > > > > > > Here's the patch. I included the content of > > > v3-fix_explain_wal_output.patch you provided before, and tried

Re: WAL usage calculation patch

2020-05-04 Thread Julien Rouhaud
On Mon, May 4, 2020 at 6:10 AM Amit Kapila wrote: > > On Thu, Apr 30, 2020 at 2:19 PM Julien Rouhaud wrote: > > > > Here's the patch. I included the content of > > v3-fix_explain_wal_output.patch you provided before, and tried to > > consistently replace full page writes/fpw to full page

Re: WAL usage calculation patch

2020-05-03 Thread Amit Kapila
On Thu, Apr 30, 2020 at 2:19 PM Julien Rouhaud wrote: > > Here's the patch. I included the content of > v3-fix_explain_wal_output.patch you provided before, and tried to > consistently replace full page writes/fpw to full page images/fpi > everywhere on top of it (so documentation, command

Re: WAL usage calculation patch

2020-05-02 Thread Amit Kapila
On Thu, Apr 30, 2020 at 2:19 PM Julien Rouhaud wrote: > > On Thu, Apr 30, 2020 at 9:18 AM Julien Rouhaud wrote: > > > > On Thu, Apr 30, 2020 at 5:05 AM Amit Kapila wrote: > > > > > > Julien, are you planning to write a cleanup patch for this open item? > > > > Sorry Amit, I've been quite busy

Re: WAL usage calculation patch

2020-04-30 Thread Julien Rouhaud
On Thu, Apr 30, 2020 at 9:18 AM Julien Rouhaud wrote: > > On Thu, Apr 30, 2020 at 5:05 AM Amit Kapila wrote: > > > > On Tue, Apr 28, 2020 at 7:38 AM Amit Kapila wrote: > > > > > > On Mon, Apr 27, 2020 at 1:22 PM Julien Rouhaud wrote: > > > > > > > > > > > I agree with that definition. I can

Re: WAL usage calculation patch

2020-04-30 Thread Julien Rouhaud
On Thu, Apr 30, 2020 at 5:05 AM Amit Kapila wrote: > > On Tue, Apr 28, 2020 at 7:38 AM Amit Kapila wrote: > > > > On Mon, Apr 27, 2020 at 1:22 PM Julien Rouhaud wrote: > > > > > > > > I agree with that definition. I can send a cleanup patch if there's > > > no objection. > > > > > > > Okay,

Re: WAL usage calculation patch

2020-04-29 Thread Amit Kapila
On Tue, Apr 28, 2020 at 7:38 AM Amit Kapila wrote: > > On Mon, Apr 27, 2020 at 1:22 PM Julien Rouhaud wrote: > > > > > I agree with that definition. I can send a cleanup patch if there's > > no objection. > > > > Okay, feel free to send the patch. Thanks for taking the initiative > to write a

Re: WAL usage calculation patch

2020-04-27 Thread Amit Kapila
On Mon, Apr 27, 2020 at 1:22 PM Julien Rouhaud wrote: > > On Mon, Apr 27, 2020 at 8:12 AM Michael Paquier wrote: > > > > On Mon, Apr 27, 2020 at 08:35:51AM +0530, Amit Kapila wrote: > > > On Thu, Apr 23, 2020 at 2:35 PM Amit Kapila > > > wrote: > > >> On Thu, Apr 23, 2020 at 12:16 PM Peter

Re: WAL usage calculation patch

2020-04-27 Thread Julien Rouhaud
On Mon, Apr 27, 2020 at 8:12 AM Michael Paquier wrote: > > On Mon, Apr 27, 2020 at 08:35:51AM +0530, Amit Kapila wrote: > > On Thu, Apr 23, 2020 at 2:35 PM Amit Kapila wrote: > >> On Thu, Apr 23, 2020 at 12:16 PM Peter Eisentraut > >> wrote: > >>> The internal symbol for the WAL record is >

Re: WAL usage calculation patch

2020-04-27 Thread Michael Paquier
On Mon, Apr 27, 2020 at 08:35:51AM +0530, Amit Kapila wrote: > On Thu, Apr 23, 2020 at 2:35 PM Amit Kapila wrote: >> On Thu, Apr 23, 2020 at 12:16 PM Peter Eisentraut >> wrote: >>> The internal symbol for the WAL record is >>> XLOG_FPI and xlogdesc.c prints it as "FPI". > > Julien, Peter,

Re: WAL usage calculation patch

2020-04-26 Thread Amit Kapila
On Thu, Apr 23, 2020 at 2:35 PM Amit Kapila wrote: > > On Thu, Apr 23, 2020 at 12:16 PM Peter Eisentraut > wrote: > > > The internal symbol for the WAL record is > > XLOG_FPI and xlogdesc.c prints it as "FPI". > > > > That is just one way/reason we log the page. There are others as > well. I

Re: WAL usage calculation patch

2020-04-23 Thread Amit Kapila
On Thu, Apr 23, 2020 at 12:16 PM Peter Eisentraut wrote: > > On 2020-04-23 07:31, Julien Rouhaud wrote: > > I agree that full page writes can be used in this case, but I'm > > wondering if that can be misleading for some reader which might e.g. > > confuse with the full_page_writes GUC. And as

Re: WAL usage calculation patch

2020-04-23 Thread Peter Eisentraut
On 2020-04-23 07:31, Julien Rouhaud wrote: I agree that full page writes can be used in this case, but I'm wondering if that can be misleading for some reader which might e.g. confuse with the full_page_writes GUC. And as Justin pointed out, the documentation for now usually mentions "full page

Re: WAL usage calculation patch

2020-04-22 Thread Kyotaro Horiguchi
At Thu, 23 Apr 2020 07:33:13 +0200, Julien Rouhaud wrote in > > > > > I think we should keep both version consistent, whether lower or upper > > > > > case. The uppercase version is probably more correct, but it's a > > > > > little bit weird to have it being the only upper case label in all >

Re: WAL usage calculation patch

2020-04-22 Thread Julien Rouhaud
On Thu, Apr 23, 2020 at 7:20 AM Amit Kapila wrote: > > On Wed, Apr 22, 2020 at 9:15 AM Amit Kapila wrote: > > > > On Mon, Apr 20, 2020 at 1:17 PM Kyotaro Horiguchi > > wrote: > > > > > > At Sun, 19 Apr 2020 16:22:26 +0200, Julien Rouhaud > > > wrote in > > > > Hi Justin, > > > > > > > >

Re: WAL usage calculation patch

2020-04-22 Thread Julien Rouhaud
On Wed, Apr 22, 2020 at 2:27 PM Amit Kapila wrote: > > On Wed, Apr 22, 2020 at 9:25 AM Justin Pryzby wrote: > > > > On Wed, Apr 22, 2020 at 09:15:08AM +0530, Amit Kapila wrote: > > > > > > And add the acronym to the docs: > > > > > > > > > > > > $ git grep 'full page' '*/explain.sgml' > > > > >

Re: WAL usage calculation patch

2020-04-22 Thread Amit Kapila
On Wed, Apr 22, 2020 at 9:15 AM Amit Kapila wrote: > > On Mon, Apr 20, 2020 at 1:17 PM Kyotaro Horiguchi > wrote: > > > > At Sun, 19 Apr 2020 16:22:26 +0200, Julien Rouhaud > > wrote in > > > Hi Justin, > > > > > > Thanks for the review! > > > > > > On Sat, Apr 18, 2020 at 10:41 PM Justin

Re: WAL usage calculation patch

2020-04-22 Thread Amit Kapila
On Wed, Apr 22, 2020 at 9:25 AM Justin Pryzby wrote: > > On Wed, Apr 22, 2020 at 09:15:08AM +0530, Amit Kapila wrote: > > > > > And add the acronym to the docs: > > > > > > > > > > $ git grep 'full page' '*/explain.sgml' > > > > > doc/src/sgml/ref/explain.sgml: number of records, number of

Re: WAL usage calculation patch

2020-04-21 Thread Justin Pryzby
On Wed, Apr 22, 2020 at 09:15:08AM +0530, Amit Kapila wrote: > > > > And add the acronym to the docs: > > > > > > > > $ git grep 'full page' '*/explain.sgml' > > > > doc/src/sgml/ref/explain.sgml: number of records, number of full > > > > page writes and amount of WAL bytes > > > > > > > >

Re: WAL usage calculation patch

2020-04-21 Thread Amit Kapila
On Mon, Apr 20, 2020 at 1:17 PM Kyotaro Horiguchi wrote: > > At Sun, 19 Apr 2020 16:22:26 +0200, Julien Rouhaud wrote > in > > Hi Justin, > > > > Thanks for the review! > > > > On Sat, Apr 18, 2020 at 10:41 PM Justin Pryzby wrote: > > > > > > Should capitalize at least the non-text one ? And

Re: WAL usage calculation patch

2020-04-19 Thread Julien Rouhaud
Hi Justin, Thanks for the review! On Sat, Apr 18, 2020 at 10:41 PM Justin Pryzby wrote: > > Should capitalize at least the non-text one ? And maybe the text one for > consistency ? > > + ExplainPropertyInteger("WAL fpw", NULL, I think we should keep both version consistent,

Re: WAL usage calculation patch

2020-04-18 Thread Justin Pryzby
On Sat, Apr 18, 2020 at 05:39:35PM +0200, Julien Rouhaud wrote: > On Sat, Apr 18, 2020 at 6:16 AM Amit Kapila wrote: > > > > On Fri, Apr 17, 2020 at 6:45 PM Peter Eisentraut > > wrote: > > > On 2020-04-14 05:57, Amit Kapila wrote: > > > > Peter E, others, any suggestions on how to move forward?

Re: WAL usage calculation patch

2020-04-18 Thread Julien Rouhaud
On Sat, Apr 18, 2020 at 6:16 AM Amit Kapila wrote: > > On Fri, Apr 17, 2020 at 6:45 PM Peter Eisentraut > wrote: > > > > On 2020-04-14 05:57, Amit Kapila wrote: > > > Peter E, others, any suggestions on how to move forward? I think here > > > we should follow the rule "follow the style of

Re: WAL usage calculation patch

2020-04-17 Thread Amit Kapila
On Fri, Apr 17, 2020 at 6:45 PM Peter Eisentraut wrote: > > On 2020-04-14 05:57, Amit Kapila wrote: > > Peter E, others, any suggestions on how to move forward? I think here > > we should follow the rule "follow the style of nearby code" which in > > this case would be to have one space after

Re: WAL usage calculation patch

2020-04-17 Thread Peter Eisentraut
On 2020-04-14 05:57, Amit Kapila wrote: Peter E, others, any suggestions on how to move forward? I think here we should follow the rule "follow the style of nearby code" which in this case would be to have one space after each field as we would like it to be closer to the "Buffers" format. It

Re: WAL usage calculation patch

2020-04-13 Thread Amit Kapila
On Wed, Apr 8, 2020 at 8:36 AM Amit Kapila wrote: > > On Tue, Apr 7, 2020 at 3:30 PM Peter Eisentraut > wrote: > > > > > > We also have existing cases for the other way: > > > > actual time=0.050..0.052 > > Buffers: shared hit=3 dirtied=1 > > > > Buffers case is not the same because

Re: WAL usage calculation patch

2020-04-13 Thread Julien Rouhaud
Le lun. 13 avr. 2020 à 13:47, Amit Kapila a écrit : > On Mon, Apr 13, 2020 at 1:10 PM Julien Rouhaud wrote: > > > > On Mon, Apr 13, 2020 at 8:11 AM Amit Kapila > wrote: > > > > > > On Sat, Apr 11, 2020 at 6:55 PM Julien Rouhaud > wrote: > > > > > > > > On Fri, Apr 10, 2020 at 9:37 PM Julien

Re: WAL usage calculation patch

2020-04-13 Thread Amit Kapila
On Mon, Apr 13, 2020 at 1:10 PM Julien Rouhaud wrote: > > On Mon, Apr 13, 2020 at 8:11 AM Amit Kapila wrote: > > > > On Sat, Apr 11, 2020 at 6:55 PM Julien Rouhaud wrote: > > > > > > On Fri, Apr 10, 2020 at 9:37 PM Julien Rouhaud wrote: > > > > > > > I tried to take into account all that have

Re: WAL usage calculation patch

2020-04-13 Thread Julien Rouhaud
On Mon, Apr 13, 2020 at 8:11 AM Amit Kapila wrote: > > On Sat, Apr 11, 2020 at 6:55 PM Julien Rouhaud wrote: > > > > On Fri, Apr 10, 2020 at 9:37 PM Julien Rouhaud wrote: > > > > > I tried to take into account all that have been discussed, but I have > > to admit that I'm absolutely not sure of

Re: WAL usage calculation patch

2020-04-13 Thread Amit Kapila
On Sat, Apr 11, 2020 at 6:55 PM Julien Rouhaud wrote: > > On Fri, Apr 10, 2020 at 9:37 PM Julien Rouhaud wrote: > > > > On Fri, Apr 10, 2020 at 8:17 AM Amit Kapila wrote: > > > Would you like to send a consolidated patch that includes Euler's > > > suggestion and Justin's patch (by making

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-12 Thread Amit Kapila
On Sun, Apr 12, 2020 at 4:03 AM Justin Pryzby wrote: > > On Sat, Mar 28, 2020 at 04:17:21PM +0100, Julien Rouhaud wrote: > > On Sat, Mar 28, 2020 at 02:38:27PM +0100, Julien Rouhaud wrote: > > > On Sat, Mar 28, 2020 at 04:14:04PM +0530, Amit Kapila wrote: > > > > > > > > I see some basic problems

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-12 Thread Julien Rouhaud
Le dim. 12 avr. 2020 à 00:33, Justin Pryzby a écrit : > On Sat, Mar 28, 2020 at 04:17:21PM +0100, Julien Rouhaud wrote: > > > > Just to be sure I did a quick test with pg_stat_statements behavior using > > parallel/non-parallel CREATE INDEX and VACUUM, and unsurprisingly buffer > usage > >

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-11 Thread Justin Pryzby
On Sat, Mar 28, 2020 at 04:17:21PM +0100, Julien Rouhaud wrote: > On Sat, Mar 28, 2020 at 02:38:27PM +0100, Julien Rouhaud wrote: > > On Sat, Mar 28, 2020 at 04:14:04PM +0530, Amit Kapila wrote: > > > > > > I see some basic problems with the patch. The way it tries to compute > > > WAL usage for

Re: WAL usage calculation patch

2020-04-11 Thread Julien Rouhaud
On Fri, Apr 10, 2020 at 9:37 PM Julien Rouhaud wrote: > > On Fri, Apr 10, 2020 at 8:17 AM Amit Kapila wrote: > > Would you like to send a consolidated patch that includes Euler's > > suggestion and Justin's patch (by making changes for points we > > discussed.)? I think we can keep the point

Re: WAL usage calculation patch

2020-04-10 Thread Julien Rouhaud
On Fri, Apr 10, 2020 at 8:17 AM Amit Kapila wrote: > > On Tue, Apr 7, 2020 at 2:48 PM Julien Rouhaud wrote: > > > > On Tue, Apr 7, 2020 at 4:36 AM Amit Kapila wrote: > > > > > > On Mon, Apr 6, 2020 at 7:58 PM Euler Taveira > > > wrote: > > > Few comments: > > > 1. > > > - int64 wal_num_fpw; /*

Re: WAL usage calculation patch

2020-04-10 Thread Amit Kapila
On Tue, Apr 7, 2020 at 2:48 PM Julien Rouhaud wrote: > > On Tue, Apr 7, 2020 at 4:36 AM Amit Kapila wrote: > > > > On Mon, Apr 6, 2020 at 7:58 PM Euler Taveira > > wrote: > > > > > > On Mon, 6 Apr 2020 at 10:37, Julien Rouhaud wrote: > > >> > > >> On Mon, Apr 06, 2020 at 10:12:55AM -0300,

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-08 Thread Amit Kapila
On Wed, Apr 8, 2020 at 1:49 PM Masahiko Sawada wrote: > > On Wed, 8 Apr 2020 at 16:04, Amit Kapila wrote: > > > > On Wed, Apr 8, 2020 at 11:53 AM Masahiko Sawada > > wrote: > > > > > > On Wed, 8 Apr 2020 at 14:44, Amit Kapila wrote: > > > > > > > > > > > > Thanks for the investigation. I

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-08 Thread Masahiko Sawada
On Wed, 8 Apr 2020 at 16:04, Amit Kapila wrote: > > On Wed, Apr 8, 2020 at 11:53 AM Masahiko Sawada > wrote: > > > > On Wed, 8 Apr 2020 at 14:44, Amit Kapila wrote: > > > > > > > > > Thanks for the investigation. I don't see we can do anything special > > > about this. In an ideal world, this

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-08 Thread Julien Rouhaud
On Wed, Apr 8, 2020 at 8:23 AM Masahiko Sawada wrote: > > On Wed, 8 Apr 2020 at 14:44, Amit Kapila wrote: > > > > On Tue, Apr 7, 2020 at 5:17 PM Masahiko Sawada > > wrote: > > > > > > On Tue, 7 Apr 2020 at 18:29, Masahiko Sawada > > > wrote: > > > > > > > > On Tue, 7 Apr 2020 at 17:42, Amit

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-08 Thread Amit Kapila
On Wed, Apr 8, 2020 at 11:53 AM Masahiko Sawada wrote: > > On Wed, 8 Apr 2020 at 14:44, Amit Kapila wrote: > > > > > > Thanks for the investigation. I don't see we can do anything special > > about this. In an ideal world, this should be done once and not for > > each worker but I guess it

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-08 Thread Masahiko Sawada
On Wed, 8 Apr 2020 at 14:44, Amit Kapila wrote: > > On Tue, Apr 7, 2020 at 5:17 PM Masahiko Sawada > wrote: > > > > On Tue, 7 Apr 2020 at 18:29, Masahiko Sawada > > wrote: > > > > > > On Tue, 7 Apr 2020 at 17:42, Amit Kapila wrote: > > > > > > > > On Tue, Apr 7, 2020 at 1:30 PM Masahiko Sawada

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-07 Thread Amit Kapila
On Tue, Apr 7, 2020 at 5:17 PM Masahiko Sawada wrote: > > On Tue, 7 Apr 2020 at 18:29, Masahiko Sawada > wrote: > > > > On Tue, 7 Apr 2020 at 17:42, Amit Kapila wrote: > > > > > > On Tue, Apr 7, 2020 at 1:30 PM Masahiko Sawada > > > wrote: > > > > > > > > Buffer usage statistics seem correct.

Re: WAL usage calculation patch

2020-04-07 Thread Amit Kapila
On Tue, Apr 7, 2020 at 3:30 PM Peter Eisentraut wrote: > > On 2020-04-07 04:12, Amit Kapila wrote: > > On Mon, Apr 6, 2020 at 10:01 PM Justin Pryzby wrote: > >> > >> On Mon, Apr 06, 2020 at 05:01:30PM +0200, Peter Eisentraut wrote: > >>> I noticed in some of the screenshots that were tweeted

Re: WAL usage calculation patch

2020-04-07 Thread Justin Pryzby
On Tue, Apr 07, 2020 at 12:00:29PM +0200, Peter Eisentraut wrote: > We also have existing cases for the other way: > > actual time=0.050..0.052 > Buffers: shared hit=3 dirtied=1 > > The cases mentioned by Justin are not formatted in a key=value format, so > it's not quite the same, but

Re: WAL usage calculation patch

2020-04-07 Thread Julien Rouhaud
On Tue, Apr 7, 2020 at 12:00 PM Peter Eisentraut wrote: > > On 2020-04-07 04:12, Amit Kapila wrote: > > On Mon, Apr 6, 2020 at 10:01 PM Justin Pryzby wrote: > >> > >> On Mon, Apr 06, 2020 at 05:01:30PM +0200, Peter Eisentraut wrote: > >>> I noticed in some of the screenshots that were tweeted

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-07 Thread Masahiko Sawada
On Tue, 7 Apr 2020 at 18:29, Masahiko Sawada wrote: > > On Tue, 7 Apr 2020 at 17:42, Amit Kapila wrote: > > > > On Tue, Apr 7, 2020 at 1:30 PM Masahiko Sawada > > wrote: > > > > > > Buffer usage statistics seem correct. The small differences would be > > > catalog lookups Peter mentioned. > > >

Re: WAL usage calculation patch

2020-04-07 Thread Peter Eisentraut
On 2020-04-07 04:12, Amit Kapila wrote: On Mon, Apr 6, 2020 at 10:01 PM Justin Pryzby wrote: On Mon, Apr 06, 2020 at 05:01:30PM +0200, Peter Eisentraut wrote: I noticed in some of the screenshots that were tweeted that for example in WAL: records=1 bytes=56 there are two spaces

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-07 Thread Masahiko Sawada
On Tue, 7 Apr 2020 at 17:42, Amit Kapila wrote: > > On Tue, Apr 7, 2020 at 1:30 PM Masahiko Sawada > wrote: > > > > Buffer usage statistics seem correct. The small differences would be > > catalog lookups Peter mentioned. > > > > Agreed, but can you check which part of code does that lookup? I

Re: WAL usage calculation patch

2020-04-07 Thread Julien Rouhaud
On Tue, Apr 7, 2020 at 4:36 AM Amit Kapila wrote: > > On Mon, Apr 6, 2020 at 7:58 PM Euler Taveira > wrote: > > > > On Mon, 6 Apr 2020 at 10:37, Julien Rouhaud wrote: > >> > >> On Mon, Apr 06, 2020 at 10:12:55AM -0300, Euler Taveira wrote: > >> > On Mon, 6 Apr 2020 at 00:25, Amit Kapila wrote:

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-07 Thread Amit Kapila
On Tue, Apr 7, 2020 at 1:30 PM Masahiko Sawada wrote: > > Buffer usage statistics seem correct. The small differences would be > catalog lookups Peter mentioned. > Agreed, but can you check which part of code does that lookup? I want to see if we can avoid that from buffer usage stats or at

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-07 Thread Masahiko Sawada
On Tue, 7 Apr 2020 at 02:40, Peter Geoghegan wrote: > > On Mon, Apr 6, 2020 at 2:21 AM Amit Kapila wrote: > > AFAIU, it uses heapam_index_build_range_scan but for writing to index, > > it doesn't use buffer manager. > > Right. It doesn't need to use the buffer manager to write to the > index,

Re: WAL usage calculation patch

2020-04-06 Thread Amit Kapila
On Mon, Apr 6, 2020 at 7:58 PM Euler Taveira wrote: > > On Mon, 6 Apr 2020 at 10:37, Julien Rouhaud wrote: >> >> On Mon, Apr 06, 2020 at 10:12:55AM -0300, Euler Taveira wrote: >> > On Mon, 6 Apr 2020 at 00:25, Amit Kapila wrote: >> > >> > > >> > > I have pushed pg_stat_statements and Explain

Re: WAL usage calculation patch

2020-04-06 Thread Amit Kapila
On Mon, Apr 6, 2020 at 10:01 PM Justin Pryzby wrote: > > On Mon, Apr 06, 2020 at 05:01:30PM +0200, Peter Eisentraut wrote: > > I noticed in some of the screenshots that were tweeted that for example in > > > > WAL: records=1 bytes=56 > > > > there are two spaces between pieces of data.

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-06 Thread Peter Geoghegan
On Mon, Apr 6, 2020 at 2:21 AM Amit Kapila wrote: > AFAIU, it uses heapam_index_build_range_scan but for writing to index, > it doesn't use buffer manager. Right. It doesn't need to use the buffer manager to write to the index, unlike (say) GIN's CREATE INDEX. -- Peter Geoghegan

Re: WAL usage calculation patch

2020-04-06 Thread Justin Pryzby
On Mon, Apr 06, 2020 at 05:01:30PM +0200, Peter Eisentraut wrote: > I noticed in some of the screenshots that were tweeted that for example in > > WAL: records=1 bytes=56 > > there are two spaces between pieces of data. This doesn't match the rest of > the EXPLAIN output. Can that be

Re: WAL usage calculation patch

2020-04-06 Thread Peter Eisentraut
I noticed in some of the screenshots that were tweeted that for example in WAL: records=1 bytes=56 there are two spaces between pieces of data. This doesn't match the rest of the EXPLAIN output. Can that be adjusted? -- Peter Eisentraut http://www.2ndQuadrant.com/

Re: WAL usage calculation patch

2020-04-06 Thread Euler Taveira
On Mon, 6 Apr 2020 at 10:37, Julien Rouhaud wrote: > On Mon, Apr 06, 2020 at 10:12:55AM -0300, Euler Taveira wrote: > > On Mon, 6 Apr 2020 at 00:25, Amit Kapila > wrote: > > > > > > > > I have pushed pg_stat_statements and Explain related patches. I am > > > now looking into (auto)vacuum patch

Re: WAL usage calculation patch

2020-04-06 Thread Julien Rouhaud
On Mon, Apr 06, 2020 at 10:12:55AM -0300, Euler Taveira wrote: > On Mon, 6 Apr 2020 at 00:25, Amit Kapila wrote: > > > > > I have pushed pg_stat_statements and Explain related patches. I am > > now looking into (auto)vacuum patch and have few comments. > > > > I wasn't paying much attention to

Re: WAL usage calculation patch

2020-04-06 Thread Euler Taveira
On Mon, 6 Apr 2020 at 00:25, Amit Kapila wrote: > > I have pushed pg_stat_statements and Explain related patches. I am > now looking into (auto)vacuum patch and have few comments. > > I wasn't paying much attention to this thread. May I suggest changing wal_num_fpw to wal_fpw? wal_records and

Re: WAL usage calculation patch

2020-04-06 Thread Julien Rouhaud
On Mon, Apr 06, 2020 at 02:34:36PM +0530, Amit Kapila wrote: > On Mon, Apr 6, 2020 at 1:53 PM Julien Rouhaud wrote: > > > > On Mon, Apr 06, 2020 at 08:55:01AM +0530, Amit Kapila wrote: > > > > > > Here, we are not displaying Buffers related data, so why do we think > > > it is important to

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-06 Thread Amit Kapila
On Mon, Apr 6, 2020 at 12:55 PM Masahiko Sawada wrote: > > On Mon, 6 Apr 2020 at 16:16, Amit Kapila wrote: > > > > On Mon, Apr 6, 2020 at 11:19 AM Masahiko Sawada > > wrote: > > > > > > The attached patch changes to the above comment and removed the code > > > that is used to un-support only

Re: WAL usage calculation patch

2020-04-06 Thread Julien Rouhaud
On Mon, Apr 06, 2020 at 08:55:01AM +0530, Amit Kapila wrote: > On Sat, Apr 4, 2020 at 2:50 PM Julien Rouhaud wrote: > > > I have pushed pg_stat_statements and Explain related patches. I am > now looking into (auto)vacuum patch and have few comments. > Thanks! > @@ -614,6 +616,9 @@

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-06 Thread Masahiko Sawada
On Mon, 6 Apr 2020 at 16:16, Amit Kapila wrote: > > On Mon, Apr 6, 2020 at 11:19 AM Masahiko Sawada > wrote: > > > > The attached patch changes to the above comment and removed the code > > that is used to un-support only buffer usage accumulation. > > > > So, IIUC, the purpose of this patch

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-06 Thread Amit Kapila
On Mon, Apr 6, 2020 at 11:19 AM Masahiko Sawada wrote: > > The attached patch changes to the above comment and removed the code > that is used to un-support only buffer usage accumulation. > So, IIUC, the purpose of this patch will be to count the buffer usage due to the heap scan (in

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-05 Thread Masahiko Sawada
On Tue, 31 Mar 2020 at 14:13, Masahiko Sawada wrote: > > On Tue, 31 Mar 2020 at 12:58, Amit Kapila wrote: > > > > On Mon, Mar 30, 2020 at 12:31 PM Masahiko Sawada > > wrote: > > > > > > The patch for vacuum conflicts with recent changes in vacuum. So I've > > > attached rebased one. > > > > > >

Re: WAL usage calculation patch

2020-04-05 Thread Amit Kapila
On Sat, Apr 4, 2020 at 2:50 PM Julien Rouhaud wrote: > > On Sat, Apr 04, 2020 at 02:39:32PM +0530, Amit Kapila wrote: > > On Sat, Apr 4, 2020 at 2:24 PM Julien Rouhaud wrote: > > > > > > > > We can add if we want but I am not able to convince myself for that. > > > > Do you have any use case in

Re: WAL usage calculation patch

2020-04-04 Thread Julien Rouhaud
On Sat, Apr 04, 2020 at 02:39:32PM +0530, Amit Kapila wrote: > On Sat, Apr 4, 2020 at 2:24 PM Julien Rouhaud wrote: > > > > > > We can add if we want but I am not able to convince myself for that. > > > Do you have any use case in mind? I think in most of the cases > > > (except for hint-bit

Re: WAL usage calculation patch

2020-04-04 Thread Amit Kapila
On Sat, Apr 4, 2020 at 2:24 PM Julien Rouhaud wrote: > > > > We can add if we want but I am not able to convince myself for that. > > Do you have any use case in mind? I think in most of the cases > > (except for hint-bit WAL) it will be zero. If we are not sure of this > > we can also discuss

Re: WAL usage calculation patch

2020-04-04 Thread Julien Rouhaud
On Sat, Apr 04, 2020 at 02:12:59PM +0530, Amit Kapila wrote: > On Sat, Apr 4, 2020 at 11:33 AM Julien Rouhaud wrote: > > > > On Sat, Apr 04, 2020 at 10:38:14AM +0530, Amit Kapila wrote: > > > > > > The patch-2 might need to be > > > > rebased if the other related patch [2] got committed first

Re: WAL usage calculation patch

2020-04-04 Thread Amit Kapila
On Sat, Apr 4, 2020 at 11:33 AM Julien Rouhaud wrote: > > On Sat, Apr 04, 2020 at 10:38:14AM +0530, Amit Kapila wrote: > > > > The patch-2 might need to be > > > rebased if the other related patch [2] got committed first and we > > > might need to tweak a bit based on the input from other thread

Re: WAL usage calculation patch

2020-04-04 Thread Julien Rouhaud
On Sat, Apr 04, 2020 at 10:38:14AM +0530, Amit Kapila wrote: > On Fri, Apr 3, 2020 at 7:36 PM Amit Kapila wrote: > > > > On Fri, Apr 3, 2020 at 9:40 AM Amit Kapila wrote: > > > > > > On Fri, Apr 3, 2020 at 9:35 AM Dilip Kumar wrote: > > > > > > > > I have analyzed the WAL and there could be

Re: WAL usage calculation patch

2020-04-03 Thread Amit Kapila
On Fri, Apr 3, 2020 at 7:36 PM Amit Kapila wrote: > > On Fri, Apr 3, 2020 at 9:40 AM Amit Kapila wrote: > > > > On Fri, Apr 3, 2020 at 9:35 AM Dilip Kumar wrote: > > > > > > I have analyzed the WAL and there could be multiple reasons for the > > > same. With small data, I have noticed that

Re: WAL usage calculation patch

2020-04-03 Thread Amit Kapila
On Fri, Apr 3, 2020 at 9:40 AM Amit Kapila wrote: > > On Fri, Apr 3, 2020 at 9:35 AM Dilip Kumar wrote: > > > > I have analyzed the WAL and there could be multiple reasons for the > > same. With small data, I have noticed that while inserting in the > > system index there was a Page Split and

Re: WAL usage calculation patch

2020-04-02 Thread Amit Kapila
On Fri, Apr 3, 2020 at 9:35 AM Dilip Kumar wrote: > > On Fri, Apr 3, 2020 at 9:17 AM Dilip Kumar wrote: > > > > On Fri, Apr 3, 2020 at 9:02 AM Amit Kapila wrote: > > > > > > On Fri, Apr 3, 2020 at 8:55 AM Dilip Kumar wrote: > > > > > > > > I think now I got the reason. Basically, both of

Re: WAL usage calculation patch

2020-04-02 Thread Dilip Kumar
On Fri, Apr 3, 2020 at 9:17 AM Dilip Kumar wrote: > > On Fri, Apr 3, 2020 at 9:02 AM Amit Kapila wrote: > > > > On Fri, Apr 3, 2020 at 8:55 AM Dilip Kumar wrote: > > > > > > I think now I got the reason. Basically, both of these records are > > > storing the FPW, and FPW size can vary based on

Re: WAL usage calculation patch

2020-04-02 Thread Dilip Kumar
On Fri, Apr 3, 2020 at 9:02 AM Amit Kapila wrote: > > On Fri, Apr 3, 2020 at 8:55 AM Dilip Kumar wrote: > > > > I think now I got the reason. Basically, both of these records are > > storing the FPW, and FPW size can vary based on the hole size on the > > page. If hold size is smaller the

Re: WAL usage calculation patch

2020-04-02 Thread Amit Kapila
On Fri, Apr 3, 2020 at 8:55 AM Dilip Kumar wrote: > > I think now I got the reason. Basically, both of these records are > storing the FPW, and FPW size can vary based on the hole size on the > page. If hold size is smaller the image length will be more, the > image_len= BLCKSZ-hole_size. So

Re: WAL usage calculation patch

2020-04-02 Thread Dilip Kumar
On Thu, Apr 2, 2020 at 9:28 PM Dilip Kumar wrote: > > On Thu, Apr 2, 2020 at 6:41 PM Amit Kapila wrote: > > > > On Thu, Apr 2, 2020 at 6:18 PM Julien Rouhaud wrote: > > > > > > =# select query, calls, wal_bytes, wal_records, wal_num_fpw from > > > pg_stat_statements where query ilike '%create

Re: WAL usage calculation patch

2020-04-02 Thread Amit Kapila
On Fri, Apr 3, 2020 at 7:15 AM Kyotaro Horiguchi wrote: > > Hello. > > The v13 patch seems failing to apply on the master. > It is probably due to recent commit ed7a509571. I have briefly studied that and I think we should make this patch account for plan time WAL usage if any similar to what

Re: WAL usage calculation patch

2020-04-02 Thread Dilip Kumar
On Fri, Apr 3, 2020 at 8:14 AM Amit Kapila wrote: > > On Fri, Apr 3, 2020 at 6:37 AM Amit Kapila wrote: > > > > On Thu, Apr 2, 2020 at 8:06 PM Dilip Kumar wrote: > > > > > > On Thu, Apr 2, 2020 at 6:41 PM Amit Kapila > > > wrote: > > > > > > > > 4. > > > > /* # of WAL full page image

Re: WAL usage calculation patch

2020-04-02 Thread Amit Kapila
On Fri, Apr 3, 2020 at 6:37 AM Amit Kapila wrote: > > On Thu, Apr 2, 2020 at 8:06 PM Dilip Kumar wrote: > > > > On Thu, Apr 2, 2020 at 6:41 PM Amit Kapila wrote: > > > > > > 4. > > > /* # of WAL full page image generated */ > > > Can we change it to "/* # of WAL full page image records

Re: WAL usage calculation patch

2020-04-02 Thread Kyotaro Horiguchi
Hello. The v13 patch seems failing to apply on the master. At Fri, 3 Apr 2020 06:37:21 +0530, Amit Kapila wrote in > On Thu, Apr 2, 2020 at 8:06 PM Dilip Kumar wrote: > > > > On Thu, Apr 2, 2020 at 6:41 PM Amit Kapila wrote: > > > > > > 4. > > > /* # of WAL full page image generated */ > >

Re: WAL usage calculation patch

2020-04-02 Thread Amit Kapila
On Thu, Apr 2, 2020 at 8:06 PM Dilip Kumar wrote: > > On Thu, Apr 2, 2020 at 6:41 PM Amit Kapila wrote: > > > > 4. > > /* # of WAL full page image generated */ > > Can we change it to "/* # of WAL full page image records generated */"? > > IMHO, "# of WAL full-page image records" seems like the

Re: WAL usage calculation patch

2020-04-02 Thread Dilip Kumar
On Thu, Apr 2, 2020 at 6:41 PM Amit Kapila wrote: > > On Thu, Apr 2, 2020 at 6:18 PM Julien Rouhaud wrote: > > > > =# select query, calls, wal_bytes, wal_records, wal_num_fpw from > > pg_stat_statements where query ilike '%create index%'; > > query |

Re: WAL usage calculation patch

2020-04-02 Thread Julien Rouhaud
On Thu, Apr 02, 2020 at 06:40:51PM +0530, Amit Kapila wrote: > On Thu, Apr 2, 2020 at 6:18 PM Julien Rouhaud wrote: > > > > =# select query, calls, wal_bytes, wal_records, wal_num_fpw from > > pg_stat_statements where query ilike '%create index%'; > > query

Re: WAL usage calculation patch

2020-04-02 Thread Dilip Kumar
On Thu, Apr 2, 2020 at 6:41 PM Amit Kapila wrote: > > On Thu, Apr 2, 2020 at 6:18 PM Julien Rouhaud wrote: > > > > =# select query, calls, wal_bytes, wal_records, wal_num_fpw from > > pg_stat_statements where query ilike '%create index%'; > > query |

Re: WAL usage calculation patch

2020-04-02 Thread Amit Kapila
On Thu, Apr 2, 2020 at 6:18 PM Julien Rouhaud wrote: > > =# select query, calls, wal_bytes, wal_records, wal_num_fpw from > pg_stat_statements where query ilike '%create index%'; > query | calls | wal_bytes | > wal_records | wal_num_fpw >

Re: WAL usage calculation patch

2020-04-02 Thread Julien Rouhaud
On Thu, Apr 02, 2020 at 02:32:07PM +0530, Amit Kapila wrote: > On Thu, Apr 2, 2020 at 2:00 PM Julien Rouhaud wrote: > > > > On Thu, Apr 02, 2020 at 11:07:29AM +0530, Amit Kapila wrote: > > > On Wed, Apr 1, 2020 at 8:00 PM Julien Rouhaud wrote: > > > > > > > > On Wed, Apr 01, 2020 at 04:29:16PM

Re: WAL usage calculation patch

2020-04-02 Thread Amit Kapila
On Thu, Apr 2, 2020 at 2:00 PM Julien Rouhaud wrote: > > On Thu, Apr 02, 2020 at 11:07:29AM +0530, Amit Kapila wrote: > > On Wed, Apr 1, 2020 at 8:00 PM Julien Rouhaud wrote: > > > > > > On Wed, Apr 01, 2020 at 04:29:16PM +0530, Amit Kapila wrote: > > > > 3. Doing some testing with and without

Re: WAL usage calculation patch

2020-04-02 Thread Julien Rouhaud
On Thu, Apr 02, 2020 at 11:07:29AM +0530, Amit Kapila wrote: > On Wed, Apr 1, 2020 at 8:00 PM Julien Rouhaud wrote: > > > > On Wed, Apr 01, 2020 at 04:29:16PM +0530, Amit Kapila wrote: > > > 3. Doing some testing with and without parallelism to ensure WAL usage > > > data is correct would be

Re: WAL usage calculation patch

2020-04-02 Thread Dilip Kumar
On Wed, Apr 1, 2020 at 8:00 PM Julien Rouhaud wrote: > > Hi, > > I'm replying here to all reviews that have been sent, thanks a lot! > > On Wed, Apr 01, 2020 at 04:29:16PM +0530, Amit Kapila wrote: > > On Wed, Apr 1, 2020 at 1:32 PM Julien Rouhaud wrote: > > > > > > So here's a v9, rebased on

Re: WAL usage calculation patch

2020-04-01 Thread Amit Kapila
On Thu, Apr 2, 2020 at 11:07 AM Amit Kapila wrote: > > On Wed, Apr 1, 2020 at 8:00 PM Julien Rouhaud wrote: > Also, I forgot to mention that let's not base this on buffer usage patch for create index (v10-0002-Allow-parallel-index-creation-to-accumulate-buff) because as per recent discussion I

Re: WAL usage calculation patch

2020-04-01 Thread Amit Kapila
On Wed, Apr 1, 2020 at 8:00 PM Julien Rouhaud wrote: > > On Wed, Apr 01, 2020 at 04:29:16PM +0530, Amit Kapila wrote: > > 3. Doing some testing with and without parallelism to ensure WAL usage > > data is correct would be great and if possible, share the results? > > > I just saw that Dilip did

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-01 Thread Dilip Kumar
On Thu, Apr 2, 2020 at 9:13 AM Dilip Kumar wrote: > > On Thu, Apr 2, 2020 at 8:34 AM Peter Geoghegan wrote: > > > > On Wed, Apr 1, 2020 at 7:52 PM Amit Kapila wrote: > > > Peter, Is this behavior expected? > > > > > > Let me summarize the situation so that it would be easier for Peter to > > >

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-01 Thread Dilip Kumar
On Thu, Apr 2, 2020 at 8:34 AM Peter Geoghegan wrote: > > On Wed, Apr 1, 2020 at 7:52 PM Amit Kapila wrote: > > Peter, Is this behavior expected? > > > > Let me summarize the situation so that it would be easier for Peter to > > comment. Julien has noticed that parallel vacuum and parallel

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-01 Thread Peter Geoghegan
On Wed, Apr 1, 2020 at 7:52 PM Amit Kapila wrote: > Peter, Is this behavior expected? > > Let me summarize the situation so that it would be easier for Peter to > comment. Julien has noticed that parallel vacuum and parallel create > index doesn't seem to report correct values for buffer usage

Re: pg_stat_statements issue with parallel maintenance (Was Re: WAL usage calculation patch)

2020-04-01 Thread Amit Kapila
Adding Peter G. On Wed, Apr 1, 2020 at 12:41 PM Dilip Kumar wrote: > > I have done some testing for the parallel "create index". > > postgres[99536]=# show maintenance_work_mem ; > maintenance_work_mem > -- > 1MB > (1 row) > > CREATE TABLE test (a int, b int); > INSERT INTO

Re: WAL usage calculation patch

2020-04-01 Thread Julien Rouhaud
Hi, I'm replying here to all reviews that have been sent, thanks a lot! On Wed, Apr 01, 2020 at 04:29:16PM +0530, Amit Kapila wrote: > On Wed, Apr 1, 2020 at 1:32 PM Julien Rouhaud wrote: > > > > So here's a v9, rebased on top of the latest versions of Sawada-san's bug > > fixes > > (Amit's v6

  1   2   >