Make nodeSort.c use Datum sorts for single column sorts
David Rowley <drowley@postgresql.org>
Make nodeSort.c use Datum sorts for single column sorts Datum sorts can be significantly faster than tuple sorts, especially when the data type being sorted is a pass-by-value type. Something in the region of 50-70% performance improvements appear to be possible. Just in case there's any confusion; the Datum sort is only used when the targetlist of the Sort node contains a single column, not when there's a single column in the sort key and multiple items in the target list. Author: Ronan Dunklau Reviewed-by: James Coleman, David Rowley, Ranier Vilela, Hou Zhijie Tested-by: John Naylor Discussion: https://postgr.es/m/3177670.itZtoPt7T5@aivenronan
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/nodeSort.c | modified | +81 −25 |
| src/include/nodes/execnodes.h | modified | +1 −0 |
Discussion
- [PATCH] Use optimized single-datum tuplesort in ExecSort 54 messages · 2021-07-06 → 2021-07-22