-
- Downloads
Permit super-MaxAllocSize allocations with MemoryContextAllocHuge().
The MaxAllocSize guard is convenient for most callers, because it reduces the need for careful attention to overflow, data type selection, and the SET_VARSIZE() limit. A handful of callers are happy to navigate those hazards in exchange for the ability to allocate a larger chunk. Introduce MemoryContextAllocHuge() and repalloc_huge(). Use this in tuplesort.c and tuplestore.c, enabling internal sorts of up to INT_MAX tuples, a factor-of-48 increase. In particular, B-tree index builds can now benefit from much-larger maintenance_work_mem settings. Reviewed by Stephen Frost, Simon Riggs and Jeff Janes.
Showing
- src/backend/utils/mmgr/aset.c 5 additions, 0 deletionssrc/backend/utils/mmgr/aset.c
- src/backend/utils/mmgr/mcxt.c 66 additions, 8 deletionssrc/backend/utils/mmgr/mcxt.c
- src/backend/utils/sort/tuplesort.c 49 additions, 42 deletionssrc/backend/utils/sort/tuplesort.c
- src/backend/utils/sort/tuplestore.c 42 additions, 35 deletionssrc/backend/utils/sort/tuplestore.c
- src/include/utils/memutils.h 16 additions, 12 deletionssrc/include/utils/memutils.h
- src/include/utils/palloc.h 4 additions, 0 deletionssrc/include/utils/palloc.h
- src/include/utils/tuplesort.h 1 addition, 1 deletionsrc/include/utils/tuplesort.h
Loading
Please register or sign in to comment