Re: Range checks of pg_test_fsync --secs-per-test and pg_test_timing --duration

2020-09-05 Thread Michael Paquier
On Fri, Sep 04, 2020 at 11:24:39PM +0200, Peter Eisentraut wrote: > According to the POSIX standard, atoi() is not required to do any error > checking, and if you want error checking, you should use strtol(). > > And if you do that, you might as well change the variables to unsigned and > use strt

Re: Multivariate MCV list vs. statistics target

2020-09-05 Thread Justin Pryzby
I think the docs are inconsistent with the commit message and the code (d06215d03) and docs should be corrected, soemthing like so: diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index b135c89005..cd10a6a6fc 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.

Re: Keep elog(ERROR) and ereport(ERROR) calls in the cold path

2020-09-05 Thread David Rowley
On Sat, 5 Sep 2020 at 08:36, Peter Eisentraut wrote: > Something based on the v4 patch makes sense. Thanks for having a look at this. > I would add DEBUG1 back into the conditional, like > > if (__builtin_constant_p(elevel) && ((elevel) >= ERROR || (elevel) <= > DEBUG1) ? \ hmm, but surely we d

Re: [PATCH] - Provide robust alternatives for replace_string

2020-09-05 Thread Tom Lane
Alvaro Herrera writes: > Note that starting with commit 67a472d71c98 you can use pg_get_line and > not worry about the hard part of this anymore :-) pg_get_line as it stands isn't quite suitable, because it just hands back a "char *" string, not a StringInfo that you can do further processing on.

Re: v13: show extended stats target in \d

2020-09-05 Thread Justin Pryzby
On Tue, Sep 01, 2020 at 05:08:25PM -0400, Alvaro Herrera wrote: > +1 on fixing this, since the ability to change stats target is new in > pg13. > > On 2020-Aug-31, Justin Pryzby wrote: > > > Maybe it should have a comma, like ", STATISTICS %s"? > > It does need some separator. Maybe a comma is

Re: logtape.c stats don't account for unused "prefetched" block numbers

2020-09-05 Thread Peter Geoghegan
On Tue, Sep 1, 2020 at 5:24 PM Peter Geoghegan wrote: > On Tue, Sep 1, 2020 at 4:36 PM Alvaro Herrera > wrote: > > This open item hasn't received any replies. I think Peter knows how to > > fix it already, but no patch has been posted ... It'd be good to get a > > move on it. > > I picked this

Re: A micro-optimisation for walkdir()

2020-09-05 Thread Ranier Vilela
Hi Juan, This is only a suggestion, if you find it appropriate. We could use a little cut tail in get_dirent_type function. Try to avoid add padding, when modifying or adding fields. struct dirent { long d_ino; unsigned short d_reclen; unsigned short d_namlen; + unsigned char d_type; cha

Re: Dubious code in pg_rewind's process_target_file()

2020-09-05 Thread Tom Lane
I wrote: > It looks to me like we could replace "exists = false" with "return", > rather than uselessly constructing a FILE_ACTION_REMOVE entry for > a file we've already proven is not there. Or actually, maybe we should just drop the lstat call altogether? AFAICS it's 99.99% redundant with the ls

Dubious code in pg_rewind's process_target_file()

2020-09-05 Thread Tom Lane
scan-build complains that "exists = false" is a dead store, which it is: process_target_file(const char *path, file_type_t type, size_t oldsize, const char *link_target) { boolexists; ... if (lstat(localpath, &statbuf) < 0) { if (errno != ENOENT

Re: [PATCH] Redudant initilization

2020-09-05 Thread Ranier Vilela
Em sáb., 5 de set. de 2020 às 14:29, Tom Lane escreveu: > Ranier Vilela writes: > > Attached is a patch I made in March/2020, but due to problems, > > it was sent but did not make the list. > > Would you mind taking a look? > > I applied some of this, but other parts had been overtaken by > even

Re: [PATCH] Redudant initilization

2020-09-05 Thread Tom Lane
Ranier Vilela writes: > Attached is a patch I made in March/2020, but due to problems, > it was sent but did not make the list. > Would you mind taking a look? I applied some of this, but other parts had been overtaken by events, and there were other changes that I didn't agree with. A general c

Re: A micro-optimisation for walkdir()

2020-09-05 Thread Juan José Santamaría Flecha
On Sat, Sep 5, 2020 at 2:13 AM Andres Freund wrote: > > > However, it looks like we might be missing a further opportunity > > here... Doesn't Windows already give us the flags we need in the > > dwFileAttributes member of the WIN32_FIND_DATA object that the > > Find{First,Next}File() functions

Re: [PATCH] Redudant initilization

2020-09-05 Thread Ranier Vilela
Em sex., 4 de set. de 2020 às 18:20, Ranier Vilela escreveu: > Em sex., 4 de set. de 2020 às 14:40, Tom Lane > escreveu: > >> Bruce Momjian writes: >> > I have to say, I am kind of stumped why compilers do not warn of such >> > cases, and why we haven't gotten reports about these cases before.

Re: Fix for configure error in 9.5/9.6 on macOS 11.0 Big Sur

2020-09-05 Thread Tom Lane
Jesse Zhang writes: > Notice that -Werror=implicit-function-declaration up there? I spent a > few minutes digging in Apple's published fork of LLVM, they've been > forcing this error flag for quite a while, but this particular > warning-turned-error is guarded by a conditional along the lines of "

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-09-05 Thread Dilip Kumar
On Sat, 5 Sep 2020 at 4:02 PM, Amit Kapila wrote: > On Tue, Sep 1, 2020 at 8:33 PM Amit Kapila > wrote: > > > > > > On Tue, Sep 1, 2020 at 9:28 AM Amit Kapila > wrote: > > > > > > I have fixed all the comments except the below comments. > > > 1. verify the size of various tests to ensure that i

Re: Use for name of unnamed portal's memory context

2020-09-05 Thread Tom Lane
Julien Rouhaud writes: > +1 too, and obviously patch looks good. The adjacent comment needs updating. regards, tom lane

Re: Improving connection scalability: GetSnapshotData()

2020-09-05 Thread Konstantin Knizhnik
On 04.09.2020 21:53, Andres Freund wrote: I also used huge_pages=on / configured them on the OS level. Otherwise TLB misses will be a significant factor. As far as I understand there should not be no any TLB misses because size of the shared buffers (8Mb) as several order of magnitude smal

Re: Switch to multi-inserts for pg_depend

2020-09-05 Thread Michael Paquier
On Fri, Sep 04, 2020 at 10:15:57AM +0900, Michael Paquier wrote: > Thanks, fixed. With the two comment fixes included, I have looked at both patches again today, and applied them. -- Michael signature.asc Description: PGP signature

Re: Yet another fast GiST build (typo)

2020-09-05 Thread Andrey M. Borodin
> 3 сент. 2020 г., в 23:40, Heikki Linnakangas написал(а): > > On 30/08/2020 15:04, Andrey M. Borodin wrote: >>> 23 авг. 2020 г., в 14:39, Andrey M. Borodin >>> написал(а): >>> >>> Thanks for reviewing and benchmarking, Pavel! >> Pavel sent me few typos offlist. PFA v12 fixing these typos. >

Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions

2020-09-05 Thread Amit Kapila
On Tue, Sep 1, 2020 at 8:33 PM Amit Kapila wrote: > > On Tue, Sep 1, 2020 at 9:28 AM Amit Kapila wrote: > > I have fixed all the comments except the below comments. > 1. verify the size of various tests to ensure that it is above > logical_decoding_work_mem. > 2. I have checked that in one of the

Re: New statistics for tuning WAL buffer size

2020-09-05 Thread Magnus Hagander
On Fri, Sep 4, 2020 at 5:42 AM Fujii Masao wrote: > > > On 2020/09/04 11:50, tsunakawa.ta...@fujitsu.com wrote: > > From: Fujii Masao > >>> I changed the view name from pg_stat_walwrites to pg_stat_walwriter. > >>> I think it is better to match naming scheme with other views like > >> pg_stat_bg