Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > (BTW, my reading of the articles I cited, as well as my own runs of the > test programs therein, suggest that in order to get a really good > performance improvement you need to hand-code calls to the POPCNT > instruction in assembly rather than rely on the compiler intrin

pgsql: Make use of compiler builtins and/or assembly for CLZ, CTZ, POPC

2019-02-15 Thread Tom Lane
Make use of compiler builtins and/or assembly for CLZ, CTZ, POPCNT. Test for the compiler builtins __builtin_clz, __builtin_ctz, and __builtin_popcount, and make use of these in preference to handwritten C code if they're available. Create src/port infrastructure for "leftmost one", "rightmost on

pgsql: Cygwin and Mingw floating-point fixes.

2019-02-15 Thread Andrew Gierth
Cygwin and Mingw floating-point fixes. Deal with silent-underflow errors in float4 for cygwin and mingw by using our strtof() wrapper; deal with misrounding errors by adding them to the resultmap. Some slight reorganization of declarations was done to avoid duplicating material between cygwin.h an

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > On 2019-Feb-15, Tom Lane wrote: >> Sure, I'll pick it up. I agree it's probably a marginal performance >> change, but it seems a shame to give up when we were 80% of the way >> there. > (BTW, my reading of the articles I cited, as well as my own runs of the > test progra

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
On 2019-Feb-15, Tom Lane wrote: > Alvaro Herrera writes: > > I'm done with this stuff. Anybody feel free to run with it, but for a > > barely noticeable performance improvement it's not going to be me. > > Sure, I'll pick it up. I agree it's probably a marginal performance > change, but it see

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > I'm done with this stuff. Anybody feel free to run with it, but for a > barely noticeable performance improvement it's not going to be me. Sure, I'll pick it up. I agree it's probably a marginal performance change, but it seems a shame to give up when we were 80% of the

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
On 2019-Feb-15, Tom Lane wrote: > Meh. I don't see why this entire function should exist if there > is nothing for it to do. I'm inclined to think that somewhere > there needs to be a symbol NEED_POPCOUNT_CHOOSING that is only > enabled if we have all three of HAVE__BUILTIN_POPCOUNT, nonempty >

pgsql: Revert attempts to use POPCNT etc instructions

2019-02-15 Thread Alvaro Herrera
Revert attempts to use POPCNT etc instructions This reverts commits fc6c72747ae6, 109de05cbb03, d0b4663c23b7 and 711bab1e4d19. Somebody will have to try harder before submitting this patch again. I've spent entirely too much time on it already, and the #ifdef maze yet to be written in order for i

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Tom Lane
Alvaro Herrera writes: > Hmm, this should fix the build, but I'm rushing out to lunch -- maybe > I'm missing something. > diff --git a/src/port/pg_bitutils.c b/src/port/pg_bitutils.c > index 97bfcebe4e1..e0198f3ab35 100644 > --- a/src/port/pg_bitutils.c > +++ b/src/port/pg_bitutils.c > @@ -90,9 +

pgsql: Refactor index cost estimation functions in view of IndexClause

2019-02-15 Thread Tom Lane
Refactor index cost estimation functions in view of IndexClause changes. Get rid of deconstruct_indexquals() in favor of just iterating over the IndexClause list directly. The extra services that that function used to provide, such as hiding clause commutation and associating the right index colu

Re: pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
Hmm, this should fix the build, but I'm rushing out to lunch -- maybe I'm missing something. diff --git a/src/port/pg_bitutils.c b/src/port/pg_bitutils.c index 97bfcebe4e1..e0198f3ab35 100644 --- a/src/port/pg_bitutils.c +++ b/src/port/pg_bitutils.c @@ -90,9 +90,11 @@ pg_popcount_available(void)

pgsql: Fix compiler builtin usage in new pg_bitutils.c

2019-02-15 Thread Alvaro Herrera
Fix compiler builtin usage in new pg_bitutils.c Split out these new functions in three parts: one in a new file that uses the compiler builtin and gets compiled with the -mpopcnt compiler option if it exists; another one that uses the compiler builtin but not the compiler option; and finally the f

pgsql: doc: Update README.links

2019-02-15 Thread Peter Eisentraut
doc: Update README.links The guideline to "not use text with so the URL appears in printed output" is obsolete, since the URL appears as a footnote in printed output in that case. Reported-by: Chapman Flack Discussion: https://www.postgresql.org/message-id/[email protected] Br

pgsql: Use standard diff separator for regression.diffs

2019-02-15 Thread Peter Eisentraut
Use standard diff separator for regression.diffs Instead of ==..., use the standard separator for a multi-file diff, which is, per POSIX, "diff %s %s %s\n", , , This makes regression.diffs behave more like a proper diff file, for use with other tools. And it shows the diff options used

pgsql: Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE

2019-02-15 Thread Michael Paquier
Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE The grammar IF NOT EXISTS for CTAS is supported since 9.5 and documented as such, however the case of using EXECUTE as query has never been covered as EXECUTE CTAS statements and normal CTAS statements are parsed separately. Author: Andreas Ka

pgsql: Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE

2019-02-15 Thread Michael Paquier
Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE The grammar IF NOT EXISTS for CTAS is supported since 9.5 and documented as such, however the case of using EXECUTE as query has never been covered as EXECUTE CTAS statements and normal CTAS statements are parsed separately. Author: Andreas Ka

pgsql: Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE

2019-02-15 Thread Michael Paquier
Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE The grammar IF NOT EXISTS for CTAS is supported since 9.5 and documented as such, however the case of using EXECUTE as query has never been covered as EXECUTE CTAS statements and normal CTAS statements are parsed separately. Author: Andreas Ka

pgsql: Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE

2019-02-15 Thread Michael Paquier
Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE The grammar IF NOT EXISTS for CTAS is supported since 9.5 and documented as such, however the case of using EXECUTE as query has never been covered as EXECUTE CTAS statements and normal CTAS statements are parsed separately. Author: Andreas Ka

pgsql: Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE

2019-02-15 Thread Michael Paquier
Fix support for CREATE TABLE IF NOT EXISTS AS EXECUTE The grammar IF NOT EXISTS for CTAS is supported since 9.5 and documented as such, however the case of using EXECUTE as query has never been covered as EXECUTE CTAS statements and normal CTAS statements are parsed separately. Author: Andreas Ka