Re: [HACKERS] [POC] Faster processing at Gather node
Robert Haas <robertmhaas@gmail.com>
Attachments
- 0002-shm-mq-reduce-receiver-latch-set-v3.patch (application/octet-stream) patch v3-0002
- 0001-shm-mq-less-spinlocks-v4.patch (application/octet-stream) patch v4-0001
- two-separate-counters.patch (application/octet-stream) patch
On Tue, Feb 27, 2018 at 4:06 PM, Andres Freund <andres@anarazel.de> wrote: >> OK, I'll try to check how feasible that would be. > > cool. It's not too hard, but it doesn't really seem to help, so I'm inclined to leave it alone. To make it work, you need to keep two separate counters in the shm_mq_handle, one for the number of bytes since we did an increment and the other for the number of bytes since we sent a signal. I don't really want to introduce that complexity unless there is a benefit. With just 0001 and 0002: 3968.899 ms, 4043.428 ms, 4042.472 ms, 4142.226 ms With two-separate-counters.patch added: 4123.841 ms, 4101.917 ms, 4063.368 ms, 3985.148 ms If you take the total of the 4 times, that's an 0.4% slowdown with the patch applied, but I think that's just noise. It seems possible that with a larger queue -- and maybe a different query shape it would help, but I really just want to get the optimizations that I've got committed, provided that you find them acceptable, rather than spend a lot of time looking for new optimizations, because: 1. I've got other things to get done. 2. I think that the patches I've got here capture most of the available benefit. 3. This case isn't super-common in the first place -- we generally want to avoid feeding tons of tuples through the Gather. 4. We might abandon the shm_mq approach entirely and switch to something like sticking tuples in DSA using the flexible tuple slot stuff you've proposed elsewhere. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Commits
-
C comment: fix wording about shared memory message queue
- bc0021ef09ec 11.0 landed
-
shm_mq: Have the receiver set the sender's less frequently.
- 497171d3e2aa 11.0 landed
-
shm_mq: Reduce spinlock usage.
- 34db06ef9a1d 11.0 landed
-
Remove use of byte-masking macros in record_image_cmp
- 0b5e33f667a2 11.0 cited
-
Remove memory leak protection from Gather and Gather Merge nodes.
- 9f4992e2a993 11.0 landed
-
Avoid projecting tuples unnecessarily in Gather and Gather Merge.
- b10967eddf96 11.0 landed
-
Tweak use of ExecContextForcesOids by Gather (Merge).
- 0510421ee091 11.0 landed
-
Pass eflags down to parallel workers.
- f455e1125e25 11.0 landed
-
Disable installcheck tests for test_session_hooks
- 745948422c79 11.0 cited
-
First-draft release notes for 10.1.
- 42de8a0255c2 11.0 cited
-
Remove TupleDesc remapping logic from tqueue.c.
- 6b65a7fe62e1 11.0 cited
-
Avoid memory leaks when a GatherMerge node is rescanned.
- 2d44c58c79ae 11.0 cited
-
Code review for nodeGatherMerge.c.
- 04e9678614ec 11.0 cited
-
Add a Gather Merge executor node.
- 355d3993c53e 10.0 cited
-
Push scan/join target list beneath Gather when possible.
- 992b5ba30dca 9.6.0 cited