Re: Parallel tuplesort (for parallel B-Tree index creation)
Peter Geoghegan <pg@heroku.com>
Attachments
- 0003-Rearrange-header-file-include-directives.patch.gz (application/x-gzip) patch 0003
- 0005-Add-force_btree_randomaccess-GUC-for-testing.patch.gz (application/x-gzip) patch 0005
- 0001-Cap-the-number-of-tapes-used-by-external-sorts.patch.gz (application/x-gzip) patch 0001
- 0002-Use-tuplesort-batch-memory-for-randomAccess-sorts.patch.gz (application/x-gzip) patch 0002
- 0004-Add-parallel-B-tree-index-build-sorting.patch.gz (application/x-gzip) patch 0004
On Sun, Sep 11, 2016 at 6:28 AM, Heikki Linnakangas <hlinnaka@iki.fi> wrote: > Pushed this "displace root" patch, with some changes: Attached is rebased version of the entire patch series, which should be applied on top of what you pushed to the master branch today. This features a new scheme for managing workMem -- maintenance_work_mem is now treated as a high watermark/budget for the entire CREATE INDEX operation, regardless of the number of workers. This seems to work much better, so Robert was right to suggest it. There were also improvements to the cost model, to weigh available maintenance_work_mem under this new system. And, the cost model was moved inside planner.c (next to plan_cluster_use_sort()), which is really where it belongs. The cost model is still WIP, though, and I didn't address some concerns of my own about how tuplesort.c coordinates workers. I think that Robert's "condition variables" will end up superseding that stuff anyway. And, I think that this v2 will bitrot fairly soon, when Heikki commits what is in effect his version of my 0002-* patch (that's unchanged, if only because it refactors some things that the parallel CREATE INDEX patch is reliant on). So, while there are still a few loose ends with this revision (it should still certainly be considered WIP), I wanted to get a revision out quickly because V1 has been left to bitrot for too long now, and my schedule is very full for the next week, ahead of my leaving to go on vacation (which is long overdue). Hopefully, I'll be able to get out a third revision next Saturday, on top of the by-then-presumably-committed new tape batch memory patch from Heikki, just before I leave. I'd rather leave with a patch available that can be cleanly applied, to make review as easy as possible, since it wouldn't be great to have this V2 with bitrot for 10 days or more. -- 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