[COMMITTERS] pgsql: Provide errno-translation wrappers around bind() and listen() on

2016-04-12 Thread Tom Lane
Provide errno-translation wrappers around bind() and listen() on Windows. I've seen one too many "could not bind IPv4 socket: No error" log entries from the Windows buildfarm members. Per previous discussion, this is likely caused by the fact that we're doing nothing to translate WSAGetLastError(

[COMMITTERS] pgsql: Fix costing for parallel aggregation.

2016-04-12 Thread Robert Haas
Fix costing for parallel aggregation. The original patch kind of ignored the fact that we were doing something different from a costing point of view, but nobody noticed. This patch fixes that oversight. David Rowley Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Kevin Grittner
On Tue, Apr 12, 2016 at 2:53 PM, Kevin Grittner wrote: > Readonly with client and job counts matching scale. Single-socket i7, BTW. >> A lot of this will be different between >> single-socket and multi-socket servers; as soon as you have the latter >> the likelihood of contention being bad goes

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Kevin Grittner
On Tue, Apr 12, 2016 at 2:28 PM, Andres Freund wrote: > On 2016-04-12 14:17:12 -0500, Kevin Grittner wrote: >> Well, something is different between your environment and mine, >> since I saw no difference at scale 100 and 2.2% at scale 200. > > In a readonly test or r/w? Readonly with client and j

[COMMITTERS] pgsql: Remove unused function GetOldestWALSendPointer from walsender co

2016-04-12 Thread Fujii Masao
Remove unused function GetOldestWALSendPointer from walsender code. That unused function was introduced as a sample because synchronous replication or replication monitoring tools might need it in the future. Recently commit 989be08 added the function SyncRepGetOldestSyncRecPtr which provides almo

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Andres Freund
Hi, On 2016-04-12 14:17:12 -0500, Kevin Grittner wrote: > Well, something is different between your environment and mine, > since I saw no difference at scale 100 and 2.2% at scale 200. In a readonly test or r/w? A lot of this will be different between single-socket and multi-socket servers; as

[COMMITTERS] pgsql: Redefine create_upper_paths_hook as being invoked once per upper

2016-04-12 Thread Tom Lane
Redefine create_upper_paths_hook as being invoked once per upper relation. Per discussion, this gives potential users of the hook more flexibility, because they can build custom Paths that implement only one stage of upper processing atop core-provided Paths for earlier stages. Branch -- mast

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Kevin Grittner
On Tue, Apr 12, 2016 at 1:56 PM, Andres Freund wrote: > On 2016-04-12 13:44:00 -0500, Kevin Grittner wrote: >> On Tue, Apr 12, 2016 at 12:38 PM, Andres Freund wrote: >>> On 2016-04-12 16:49:25 +, Kevin Grittner wrote: On a big NUMA machine with 1000 connections in saturation load th

Re: [COMMITTERS] pgsql: Add the "snapshot too old" feature

2016-04-12 Thread Andres Freund
On 2016-04-12 13:57:26 -0500, Kevin Grittner wrote: > I have booked two large NUMA machines for Friday to look for any > remaining performance regressions on high-concurrency loads on such > machines. Anyone with ideas on particular tests that they feel > should be included, please let me know bef

Re: [COMMITTERS] pgsql: Add the "snapshot too old" feature

2016-04-12 Thread Kevin Grittner
On Mon, Apr 11, 2016 at 12:31 PM, Kevin Grittner wrote: > On Mon, Apr 11, 2016 at 8:20 AM, Alexander Korotkov >> So, for read-only benchmark this patch introduces more than 5 times >> regression on big machine. > > I did not schedule a saturation test on a big machine. I guess I > should have do

Re: [HACKERS] Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Andres Freund
On 2016-04-12 13:44:00 -0500, Kevin Grittner wrote: > On Tue, Apr 12, 2016 at 12:38 PM, Andres Freund wrote: > > On 2016-04-12 16:49:25 +, Kevin Grittner wrote: > >> On a big NUMA machine with 1000 connections in saturation load > >> there was a performance regression due to spinlock contentio

Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Kevin Grittner
On Tue, Apr 12, 2016 at 12:38 PM, Andres Freund wrote: > On 2016-04-12 16:49:25 +, Kevin Grittner wrote: >> On a big NUMA machine with 1000 connections in saturation load >> there was a performance regression due to spinlock contention, for >> acquiring values which were never used. Just fill

Re: [COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Andres Freund
On 2016-04-12 16:49:25 +, Kevin Grittner wrote: > On a big NUMA machine with 1000 connections in saturation load > there was a performance regression due to spinlock contention, for > acquiring values which were never used. Just fill with dummy > values if we're not going to use them. FWIW, I

[COMMITTERS] pgsql: Improve coding of column-name parsing in psql's new crosstabview

2016-04-12 Thread Tom Lane
Improve coding of column-name parsing in psql's new crosstabview.c. Coverity complained about this code, not without reason because it was rather messy. Adjust it to not scribble on the passed string; that adds one malloc/free cycle per column name, which is going to be insignificant in context.

[COMMITTERS] pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold

2016-04-12 Thread Kevin Grittner
Avoid extra locks in GetSnapshotData if old_snapshot_threshold < 0 On a big NUMA machine with 1000 connections in saturation load there was a performance regression due to spinlock contention, for acquiring values which were never used. Just fill with dummy values if we're not going to use them.

[COMMITTERS] pgsql: Improve API of GenericXLogRegister().

2016-04-12 Thread Tom Lane
Improve API of GenericXLogRegister(). Rename this function to GenericXLogRegisterBuffer() to make it clearer what it does, and leave room for other sorts of "register" actions in future. Also, replace its "bool isNew" argument with an integer flags argument, so as to allow adding more flags in fu

[COMMITTERS] pgsql: Add page id to bloom index

2016-04-12 Thread Teodor Sigaev
Add page id to bloom index Added to ensure that bloom index pages can be distinguished from other pages by pg_filedump. Because there wasn't any public/production versions before, it doesn't pay attention to any compatibility issues. Per notice from Tom Lane Branch -- master Details ---

[COMMITTERS] pgsql: In generic WAL application and replay, ensure page "hole" is alw

2016-04-12 Thread Tom Lane
In generic WAL application and replay, ensure page "hole" is always zero. The previous coding could allow the contents of the "hole" between pd_lower and pd_upper to diverge during replay from what it had been when the update was originally applied. This would pose a problem if checksums were in

[COMMITTERS] pgsql: Remove unnecessary definition of _WIN64 in libpq/win32.mak.

2016-04-12 Thread Tom Lane
Remove unnecessary definition of _WIN64 in libpq/win32.mak. In commit b0e40d189325dc7a54d2546245e766f8c47a7c8d, I should have just removed the /D switch defining WIN64. The reason the code worked before is that all Windows64 compilers automatically predefine _WIN64. Perhaps at one time we had co

[COMMITTERS] pgsql: Correct copyright for newly added genericdesc.c

2016-04-12 Thread Stephen Frost
Correct copyright for newly added genericdesc.c It's 2016 these days (no, not entirely sure how we got here either). Pointed out by Amit Langote Branch -- master Details --- http://git.postgresql.org/pg/commitdiff/cd13471f2e9dee6d411cae3ddae72d0ad6b58c4d Modified Files -- s