Re: Parallel tuplesort (for parallel B-Tree index creation)
Peter Geoghegan <pg@bowt.ie>
On Fri, Feb 3, 2017 at 4:15 PM, Thomas Munro <thomas.munro@enterprisedb.com> wrote: >> I suspect that this system isn't particularly well balanced for the >> task of benchmarking the patch. You would probably see notably better >> scalability than any you've shown in any test if you could add >> additional sequential I/O bandwidth, which is probably an economical, >> practical choice for many users. I suspect that you aren't actually >> saturating available CPUs to the greatest extent that the >> implementations makes possible. > > I will look into what IO options I can access before running larger > tests. Also I will look into running the test with both cold and warm > caches (ie "echo 1 > /proc/sys/vm/drop_caches") so that read bandwidth > enters the picture. It might just have been that the table was too small to be an effective target for parallel sequential scan with so many workers, and so a presorted best case CREATE INDEX, which isn't that different, also fails to see much benefit (compared to what you'd see with a similar case involving a larger table). In other words, I might have jumped the gun in emphasizing issues with hardware and I/O bandwidth over issues around data volume (that I/O parallelism is inherently not very helpful with these relatively small tables). As I've pointed out a couple of times before, bigger sorts will be more CPU bound because sorting itself has costs that grow linearithmically, whereas writing out runs has costs that grow linearly. The relative cost of the I/O can be expected to go down as input goes up for this reason. At the same time, a larger input might make better use of I/O parallelism, which reduces the cost paid in latency to write out runs in absolute terms. -- Peter Geoghegan
Commits
-
Support parallel btree index builds.
- 9da0cc35284b 11.0 landed
-
Report an ERROR if a parallel worker fails to start properly.
- 2badb5afb89c 11.0 cited
-
Transfer state pertaining to pending REINDEX operations to workers.
- 29d58fd3adae 11.0 landed
-
Add a barrier primitive for synchronizing backends.
- 1145acc70deb 11.0 cited
-
Allow DML commands that create tables to use parallel query.
- e9baa5e9fa14 11.0 cited
-
Refactor GetOldestXmin() to use flags
- af4b1a0869bd 10.0 cited
-
Fix regression in parallel planning against inheritance tables.
- 2609e91fcf9d 10.0 cited
-
Don't create "holes" in BufFiles, in the new logtape code.
- 7ac4a389a7db 10.0 cited
-
Simplify the code for logical tape read buffers.
- b75f467b6eec 10.0 cited
-
Fix excessive memory consumption in the new sort pre-reading code.
- b56fb691b003 10.0 cited
-
Implement binary heap replace-top operation in a smarter way.
- 24598337c8d2 10.0 cited
-
Cosmetic code cleanup in commands/extension.c.
- 25794e841e5b 10.0 cited
-
Speed up planner's scanning for parallel-query hazards.
- da1c91631e35 10.0 cited
-
Read from the same worker repeatedly until it returns no tuple.
- bc7fcab5e36b 9.6.0 cited
-
Improve tuplesort.c to support variable merge order. The original coding
- df700e6b4019 8.2.0 cited