summaryrefslogtreecommitdiff
path: root/src/include/nodes/execnodes.h
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2021-07-22 14:03:19 +1200
committerDavid Rowley <drowley@postgresql.org>2021-07-22 14:03:19 +1200
commit91e9e89dccdfdf4216953d3d8f5515dcdef177fb (patch)
treea5e65de17f8beddb4c3edda646183ec31795e201 /src/include/nodes/execnodes.h
parent7fa1e1ef741964eeb50f33d7c72622658bb7e5f4 (diff)
downloadpostgresql-91e9e89dccdfdf4216953d3d8f5515dcdef177fb.tar.gz
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
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r--src/include/nodes/execnodes.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index ffc7844756..37cb4f3d59 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -2151,6 +2151,7 @@ typedef struct SortState
int64 bound_Done; /* value of bound we did the sort with */
void *tuplesortstate; /* private state of tuplesort.c */
bool am_worker; /* are we a worker? */
+ bool datumSort; /* Datum sort instead of tuple sort? */
SharedSortInfo *shared_info; /* one entry per worker */
} SortState;