postgresql/src/include/utils
Heikki Linnakangas e94568ecc1 Change the way pre-reading in external sort's merge phase works.
Don't pre-read tuples into SortTuple slots during merge. Instead, use the
memory for larger read buffers in logtape.c. We're doing the same number
of READTUP() calls either way, but managing the pre-read SortTuple slots
is much more complicated. Also, the on-tape representation is more compact
than SortTuples, so we can fit more pre-read tuples into the same amount
of memory this way. And we have better cache-locality, when we use just a
small number of SortTuple slots.

Now that we only hold one tuple from each tape in the SortTuple slots, we
can greatly simplify the "batch memory" management. We now maintain a
small set of fixed-sized slots, to hold the tuples, and fall back to
palloc() for larger tuples. We use this method during all merge phases,
not just the final merge, and also when randomAccess is requested, and
also in the TSS_SORTEDONTAPE case. In other words, it's used whenever we
do an external sort.

Reviewed by Peter Geoghegan and Claudio Freire.

Discussion: <CAM3SWZTpaORV=yQGVCG8Q4axcZ3MvF-05xe39ZvORdU9JcD6hQ@mail.gmail.com>
2016-10-03 13:37:49 +03:00
..
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
acl.h Add location field to DefElem 2016-09-06 12:00:00 -04:00
aclchk_internal.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
array.h In plpgsql, don't try to convert int2vector or oidvector to expanded array. 2016-08-18 14:49:08 -04:00
arrayaccess.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
ascii.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
attoptcache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
builtins.h Add txid_current_ifassigned(). 2016-08-23 10:30:52 -04:00
bytea.h Extend sortsupport for text to more opclasses. 2016-02-03 14:29:53 -05:00
cash.h Add casts from int4 and int8 to numeric. 2011-04-05 09:35:43 -04:00
catcache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
combocid.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
date.h Improve parsetree representation of special functions such as CURRENT_DATE. 2016-08-16 20:33:01 -04:00
datetime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
datum.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
dynahash.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
dynamic_loader.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
elog.h Improve unreachability recognition in elog() macro. 2016-09-10 17:54:23 -04:00
evtcache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
expandeddatum.h Inline the easy cases in MakeExpandedObjectReadOnly(). 2016-06-03 18:34:05 -04:00
fmgrtab.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
formatting.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
geo_decls.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
guc.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
guc_tables.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
help_config.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
hsearch.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
index_selfuncs.h Restructure index access method API to hide most of it at the C level. 2016-01-17 19:36:59 -05:00
inet.h Create an SP-GiST opclass for inet/cidr. 2016-08-23 15:16:30 -04:00
int8.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
inval.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
json.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
jsonapi.h pgindent run for 9.6 2016-06-09 18:02:36 -04:00
jsonb.h Fix breakage in previous change 2016-09-30 15:27:51 -04:00
logtape.h Change the way pre-reading in external sort's merge phase works. 2016-10-03 13:37:49 +03:00
lsyscache.h Improve index AMs' opclass validation procedures. 2016-01-21 19:47:15 -05:00
memdebug.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
memutils.h Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
nabstime.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
numeric.h Remove bogus dependencies on NUMERIC_MAX_PRECISION. 2016-08-14 15:06:01 -04:00
palloc.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_crc.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_locale.h Cope if platform declares mbstowcs_l(), but not locale_t, in <xlocale.h>. 2016-03-15 13:19:57 -04:00
pg_lsn.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
pg_rusage.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
plancache.h Avoid invalidating all foreign-join cached plans when user mappings change. 2016-07-15 17:23:02 -04:00
portal.h Fix TOAST access failure in RETURNING queries. 2016-08-07 17:46:08 -04:00
ps_status.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
rangetypes.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rel.h Restore foreign-key-aware estimation of join relation sizes. 2016-06-18 15:22:34 -04:00
relcache.h Restore foreign-key-aware estimation of join relation sizes. 2016-06-18 15:22:34 -04:00
relfilenodemap.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
relmapper.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
reltrigger.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
resowner.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
resowner_private.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
rls.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
ruleutils.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
sampling.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
selfuncs.h Support CREATE ACCESS METHOD 2016-03-23 23:01:35 -03:00
snapmgr.h Prevent "snapshot too old" from trying to return pruned TOAST tuples. 2016-08-03 16:50:01 -04:00
snapshot.h Add the "snapshot too old" feature 2016-04-08 14:36:30 -05:00
sortsupport.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
spccache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
syscache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
timeout.h Be more predictable about reporting "lock timeout" vs "statement timeout". 2016-05-27 10:40:20 -04:00
timestamp.h Improve parsetree representation of special functions such as CURRENT_DATE. 2016-08-16 20:33:01 -04:00
tqual.h Fix copy-and-pasteo in 81c766b3fd. 2016-08-05 16:21:38 -04:00
tuplesort.h Reuse abbreviated keys in ordered [set] aggregates. 2016-02-17 15:40:00 +05:30
tuplestore.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
typcache.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
tzparser.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
uuid.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
varbit.h Update copyright for 2016 2016-01-02 13:33:40 -05:00
xml.h Update copyright for 2016 2016-01-02 13:33:40 -05:00