[COMMITTERS] pgsql: Reduce "X = X" to "X IS NOT NULL", if it's easy to do so.

2017-10-08 Thread Tom Lane
Reduce "X = X" to "X IS NOT NULL", if it's easy to do so. If the operator is a strict btree equality operator, and X isn't volatile, then the clause must yield true for any non-null value of X, or null if X is null. At top level of a WHERE clause, we can ignore the distinction between false and

[COMMITTERS] pgsql: Reduce memory usage of targetlist SRFs.

2017-10-08 Thread Andres Freund
Reduce memory usage of targetlist SRFs. Previously nodeProjectSet only released memory once per input tuple, rather than once per returned tuple. If the computation of an individual returned tuple requires a lot of memory, that can lead to problems. Instead change things so that the expression

[COMMITTERS] pgsql: Increase distance between flush requests during bulk file copies

2017-10-08 Thread Tom Lane
Increase distance between flush requests during bulk file copies. copy_file() reads and writes data 64KB at a time (with default BLCKSZ), and historically has issued a pg_flush_data request after each write. This turns out to interact really badly with macOS's new APFS file system: a large file

[COMMITTERS] pgsql: Increase distance between flush requests during bulk file copies

2017-10-08 Thread Tom Lane
Increase distance between flush requests during bulk file copies. copy_file() reads and writes data 64KB at a time (with default BLCKSZ), and historically has issued a pg_flush_data request after each write. This turns out to interact really badly with macOS's new APFS file system: a large file

[COMMITTERS] pgsql: Increase distance between flush requests during bulk file copies

2017-10-08 Thread Tom Lane
Increase distance between flush requests during bulk file copies. copy_file() reads and writes data 64KB at a time (with default BLCKSZ), and historically has issued a pg_flush_data request after each write. This turns out to interact really badly with macOS's new APFS file system: a large file