postgresql/src/include
David Rowley d37aa3d358 Allow nodeSort to perform Datum sorts for byref types
Here we add a new 'copy' parameter to tuplesort_getdatum so that we can
instruct the function not to datumCopy() byref Datums before returning.

Similar to 91e9e89dc, this can provide significant performance
improvements in nodeSort when sorting by a single byref column and the
sort's targetlist contains only that column.

This allows us to re-enable Datum sorts for byref types which was disabled
in 3a5817695 due to a reported memory leak.

Additionally, here we slightly optimize DISTINCT aggregates so that we no
longer perform any datumCopy() when we find the current value not to be
distinct from the previous value.  Previously the code would always take a
copy of the most recent Datum and pfree the previous value, even when the
values were the same.  Testing shows a small but noticeable performance
increase when aggregate transitions are skipped due to the current
transition value being the same as the prior one.

Author: David Rowley
Discussion: https://postgr.es/m/CAApHDvqS6wC5U==k9Hd26E4EQXH3QR67-T4=Q1rQ36NGvjfVSg@mail.gmail.com
Discussion: https://postgr.es/m/CAApHDvqHonfe9G1cVaKeHbDx70R_zCrM3qP2AGXpGrieSKGnhA@mail.gmail.com
2022-10-28 09:25:12 +13:00
..
access Reduce xlog.h inclusion footprint 2022-10-12 09:47:11 +02:00
backup Reduce basebackup_sink.h inclusion footprint 2022-10-12 09:42:20 +02:00
bootstrap Harmonize more lexer function parameter names. 2022-09-22 13:27:16 -07:00
catalog Add rule_number to pg_hba_file_rules and map_number to pg_ident_file_mappings 2022-10-26 15:22:15 +09:00
commands Allow batch insertion during COPY into a foreign table. 2022-10-13 18:45:00 +09:00
common Move pg_pwritev_with_retry() to src/common/file_utils.c 2022-10-27 14:39:42 +09:00
datatype Fix overflow hazards in interval input and output conversions. 2022-04-02 16:12:29 -04:00
executor Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
fe_utils Revert 56-bit relfilenode change and follow-up commits. 2022-09-28 09:55:28 -04:00
foreign Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
jit Add central declarations for dlsym()ed symbols 2022-07-17 17:23:42 -07:00
lib Rename shadowed local variables 2022-10-05 21:01:41 +13:00
libpq Refactor code handling the names of files loaded in hba.c 2022-10-26 11:42:13 +09:00
mb Harmonize parameter names in storage and AM code. 2022-09-19 19:18:36 -07:00
nodes Update some comments that should've covered MERGE 2022-10-24 12:52:43 +02:00
optimizer Revert "Optimize order of GROUP BY keys". 2022-10-03 10:56:16 -04:00
parser Record dependencies of a cast on other casts that it requires. 2022-10-17 14:02:05 -04:00
partitioning Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
pch meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
port mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc 2022-09-30 10:50:05 -07:00
portability Fix obsolete comments in instr_time.h. 2022-08-09 11:50:03 +12:00
postmaster Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
regex Consistently use named parameters in regex code. 2022-09-19 15:10:24 -07:00
replication Add a common function to generate the origin name. 2022-10-11 10:37:52 +05:30
rewrite Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
snowball Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
statistics Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
storage Move pg_pwritev_with_retry() to src/common/file_utils.c 2022-10-27 14:39:42 +09:00
tcop Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
tsearch Introduce t_isalnum() to replace t_isalpha() || t_isdigit() tests. 2022-10-06 11:08:56 -04:00
utils Allow nodeSort to perform Datum sorts for byref types 2022-10-28 09:25:12 +13:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
Makefile Move gramparse.h to src/backend/parser 2022-09-14 10:57:13 +07:00
c.h Remove Abs() 2022-10-12 06:53:47 +02:00
fmgr.h Mark all symbols exported from extension libraries PGDLLEXPORT. 2022-07-17 18:50:14 -07:00
funcapi.h Remove compatibility declarations for InitMaterializedSRF() 2022-10-18 10:44:02 +09:00
getopt_long.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
meson.build meson: Add support for building with precompiled headers 2022-10-06 17:19:30 -07:00
miscadmin.h Introduce SYSTEM_USER 2022-09-29 15:05:40 +09:00
pg_config.h.in Remove configure probe for sockaddr_in6 and require AF_INET6. 2022-08-26 10:18:30 +12:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Remove our artificial PG_SOMAXCONN limit on listen queue length. 2022-08-23 10:15:06 -04:00
pg_getopt.h Apply PGDLLIMPORT markings broadly. 2022-04-08 08:16:38 -04:00
pg_trace.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgstat.h pgstat: Track time of the last scan of a relation 2022-10-14 11:11:34 -07:00
pgtar.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgtime.h Harmonize more parameter names in bulk. 2022-09-20 13:09:30 -07:00
port.h pg_basebackup: Fix cross-platform tablespace relocation. 2022-10-21 08:21:55 -04:00
postgres.h Simplify our Assert infrastructure a little. 2022-10-10 15:16:56 -04:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
windowapi.h Update copyright for 2022 2022-01-07 19:04:57 -05:00