Re: [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Noah Misch
In an earlier message, I said I didn't see the problem with xlc 13.1.3. I withdraw that statement. I had tested old code (commit c629324, 20 Aug), rendering the test invalid. xlc 13.1.3 does break commit 91d5f1a, and removing "restrict" fixes things as it did the older version. On Thu, Oct 12,

Re: [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Andres Freund
On 2017-10-12 19:35:36 -0700, Noah Misch wrote: > On Thu, Oct 12, 2017 at 04:08:44PM -0700, Andres Freund wrote: > > So we've two animals (hornet, sungazer) that are: > > #define SIZEOF_SIZE_T 8 > > #define WORDS_BIGENDIAN 1 > > #define restrict __restrict > > > > one compiled with xlc that fails

Re: [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Andres Freund
Hi, On 2017-10-13 00:02:47 -0700, Noah Misch wrote: > I hacked psql to call PQtrace() and ran "psql -Xc 'select true'" in the > defective configuration and in a working x64 GNU/Linux configuration. I've > attached both PQtrace() products. Thanks! > To backend> Msg Q > To backend> "select true"

Re: [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Tom Lane
Noah Misch writes: > I hacked psql to call PQtrace() and ran "psql -Xc 'select true'" in the > defective configuration and in a working x64 GNU/Linux configuration. I've > attached both PQtrace() products. Thanks. It looks to me like the xlc build simply forgets to send some of the T-message fi

[COMMITTERS] pgsql: Rely on sizeof(typename) rather than sizeof(variable) in pqforma

2017-10-13 Thread Tom Lane
Rely on sizeof(typename) rather than sizeof(variable) in pqformat.h. In each of the pq_writeintN functions, the three uses of sizeof() should surely all be consistent. I started out to make them all sizeof(ni), but on reflection let's make them sizeof(typename) instead. That's more like our usua

[COMMITTERS] pgsql: Improve implementation of CRE-stack-flattening in map_variable_a

2017-10-13 Thread Tom Lane
Improve implementation of CRE-stack-flattening in map_variable_attnos(). I (tgl) objected to the obscure implementation introduced in commit 1c497fa72. This one seems a bit less action-at-a-distance-y, at the price of repeating a few lines of code. Improve the comments about what the function is

Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Tom Lane
I wrote: > Anyway, I will go make the sizeof() usages consistent, just to satisfy > my own uncontrollable neatnik-ism. Assuming that hornet stays red, > which is probable, we should disable "restrict" for that compiler. As expected, that didn't fix it. Andres, are you going to put in a disable?

Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Andres Freund
On 2017-10-13 13:48:07 -0400, Tom Lane wrote: > I wrote: > > Anyway, I will go make the sizeof() usages consistent, just to satisfy > > my own uncontrollable neatnik-ism. Assuming that hornet stays red, > > which is probable, we should disable "restrict" for that compiler. > > As expected, that d

Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Tom Lane
Andres Freund writes: > A easiest way to do this would be to put something like > CPPFLAGS="$CPPFLAGS -Dpg_restrict" into the existing > if test "$GCC" != yes ; then > block in a/src/template/linux. But that'd probably result in "macro > redefined" warnings or somesuch. You mean src/template/aix,

Re: [HACKERS] [COMMITTERS] pgsql: Improve performance of SendRowDescriptionMessage.

2017-10-13 Thread Andres Freund
On 2017-10-13 14:19:22 -0400, Tom Lane wrote: > > So it'd probably better to introduce a FORCE_DISABLE_RESTRICT=yes, set > > at the same place, that's then tested before running the relevant > > configure check? > > +1. I think you don't actually have to skip the configure check, > and there migh

[COMMITTERS] pgsql: Fix possible crash with Parallel Bitmap Heap Scan.

2017-10-13 Thread Robert Haas
Fix possible crash with Parallel Bitmap Heap Scan. If a Parallel Bitmap Heap scan's chain of leftmost descendents includes a BitmapOr whose first child is a BitmapAnd, the prior coding would mistakenly create a non-shared TIDBitmap and then try to perform shared iteration. Report by Tomas Vondra.

[COMMITTERS] pgsql: Fix possible crash with Parallel Bitmap Heap Scan.

2017-10-13 Thread Robert Haas
Fix possible crash with Parallel Bitmap Heap Scan. If a Parallel Bitmap Heap scan's chain of leftmost descendents includes a BitmapOr whose first child is a BitmapAnd, the prior coding would mistakenly create a non-shared TIDBitmap and then try to perform shared iteration. Report by Tomas Vondra.

[COMMITTERS] pgsql: Force "restrict" not to be used when compiling with xlc.

2017-10-13 Thread Andres Freund
Force "restrict" not to be used when compiling with xlc. Per buildfarm animal Hornet and followup manual testing by Noah Misch, it appears xlc miscompiles code using "restrict" in at least some cases. Allow disabling restrict usage with FORCE_DISABLE_RESTRICT=yes in template files, and do so for a

[COMMITTERS] pgsql: Add pg_noinline macro to c.h.

2017-10-13 Thread Andres Freund
Add pg_noinline macro to c.h. Forcing a function not to be inlined can be useful if it's the slow-path of a performance critical function, or should be visible in profiles to allow for proper cost attribution. Author: Andres Freund Discussion: https://postgr.es/m/20170914061207.zxotvyopetm7l...@

[COMMITTERS] pgsql: Improve sys/catcache performance.

2017-10-13 Thread Andres Freund
Improve sys/catcache performance. The following are the individual improvements: 1) Avoidance of FunctionCallInfo based function calls, replaced by more efficient functions with a native C argument interface. 2) Don't extract columns from a cache entry's tuple whenever matching entries - ins

Re: [COMMITTERS] pgsql: Add pg_noinline macro to c.h.

2017-10-13 Thread Tom Lane
Andres Freund writes: > Add pg_noinline macro to c.h. I think you want this to be parenthesized so that pgindent doesn't go nuts when you use it. At least, that was the reason why pg_attribute_noreturn() has parens. Even if the current version of pgindent doesn't have that problem, I would argu

Re: [COMMITTERS] pgsql: Add pg_noinline macro to c.h.

2017-10-13 Thread Andres Freund
On 2017-10-13 18:32:08 -0400, Tom Lane wrote: > Andres Freund writes: > > Add pg_noinline macro to c.h. > > I think you want this to be parenthesized so that pgindent doesn't > go nuts when you use it. At least, that was the reason why > pg_attribute_noreturn() has parens. Even if the current v

[COMMITTERS] pgsql: Add missing options to pg_regress help() output

2017-10-13 Thread Joe Conway
Add missing options to pg_regress help() output A few command line options accepted by pg_regress were not being output by help(), including --help itself. Add that one, as well as --version and --bindir, and the corresponding short options for the first two. We could consider this for backpatchi