postgresql/src/include/utils
Tom Lane 1dc5ebc907 Support "expanded" objects, particularly arrays, for better performance.
This patch introduces the ability for complex datatypes to have an
in-memory representation that is different from their on-disk format.
On-disk formats are typically optimized for minimal size, and in any case
they can't contain pointers, so they are often not well-suited for
computation.  Now a datatype can invent an "expanded" in-memory format
that is better suited for its operations, and then pass that around among
the C functions that operate on the datatype.  There are also provisions
(rudimentary as yet) to allow an expanded object to be modified in-place
under suitable conditions, so that operations like assignment to an element
of an array need not involve copying the entire array.

The initial application for this feature is arrays, but it is not hard
to foresee using it for other container types like JSON, XML and hstore.
I have hopes that it will be useful to PostGIS as well.

In this initial implementation, a few heuristics have been hard-wired
into plpgsql to improve performance for arrays that are stored in
plpgsql variables.  We would like to generalize those hacks so that
other datatypes can obtain similar improvements, but figuring out some
appropriate APIs is left as a task for future work.  (The heuristics
themselves are probably not optimal yet, either, as they sometimes
force expansion of arrays that would be better left alone.)

Preliminary performance testing shows impressive speed gains for plpgsql
functions that do element-by-element access or update of large arrays.
There are other cases that get a little slower, as a result of added array
format conversions; but we can hope to improve anything that's annoyingly
bad.  In any case most applications should see a net win.

Tom Lane, reviewed by Andres Freund
2015-05-14 12:08:49 -04:00
..
.gitignore
acl.h Allow CURRENT/SESSION_USER to be used in certain commands 2015-03-09 15:41:54 -03:00
aclchk_internal.h Allow on-the-fly capture of DDL event details 2015-05-11 19:14:31 -03:00
array.h Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
arrayaccess.h Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
ascii.h
attoptcache.h
builtins.h Allow on-the-fly capture of DDL event details 2015-05-11 19:14:31 -03:00
bytea.h
cash.h
catcache.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
combocid.h Create an infrastructure for parallel computation in PostgreSQL. 2015-04-30 15:02:14 -04:00
date.h Define integer limits independently from the system definitions. 2015-04-02 17:43:35 +02:00
datetime.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
datum.h Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
dynahash.h
dynamic_loader.h
elog.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
evtcache.h
expandeddatum.h Support "expanded" objects, particularly arrays, for better performance. 2015-05-14 12:08:49 -04:00
fmgrtab.h
formatting.h
geo_decls.h Add geometry/range functions to support BRIN inclusion 2015-05-05 15:22:24 -03:00
guc_tables.h
guc.h Use abbreviated keys for faster sorting of numeric datums. 2015-04-02 14:04:26 -04:00
help_config.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
hsearch.h
inet.h Add index-only scan support to inet GiST opclass. 2015-03-28 15:11:53 +02:00
int8.h
inval.h
json.h
jsonapi.h
jsonb.h Additional functions and operators for jsonb 2015-05-12 15:52:45 -04:00
logtape.h
lsyscache.h Add transforms feature 2015-04-26 10:33:14 -04:00
memdebug.h
memutils.h Move memory context callback declarations into palloc.h. 2015-03-01 12:31:32 -05:00
nabstime.h
numeric.h
palloc.h Add palloc_extended for frontend and backend. 2015-04-03 17:36:12 +09:00
pg_crc.h Reorganize our CRC source files again. 2015-04-14 17:03:42 +03:00
pg_locale.h
pg_lsn.h
pg_rusage.h
plancache.h
portal.h
ps_status.h
rangetypes.h Add geometry/range functions to support BRIN inclusion 2015-05-05 15:22:24 -03:00
rel.h Add log_min_autovacuum_duration per-table option 2015-04-03 11:55:50 -03:00
relcache.h
relfilenodemap.h
relmapper.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
reltrigger.h
resowner_private.h
resowner.h
rls.h
ruleutils.h
selfuncs.h
snapmgr.h Create an infrastructure for parallel computation in PostgreSQL. 2015-04-30 15:02:14 -04:00
snapshot.h Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE. 2015-05-08 05:43:10 +02:00
sortsupport.h
spccache.h
syscache.h Introduce replication progress tracking infrastructure. 2015-04-29 19:30:53 +02:00
timeout.h
timestamp.h Add transform functions for AT TIME ZONE. 2015-03-01 13:22:34 -05:00
tqual.h
tuplesort.h
tuplestore.h
typcache.h Use the typcache to cache constraints for domain types. 2015-03-01 14:06:55 -05:00
tzparser.h
uuid.h
varbit.h Use FLEXIBLE_ARRAY_MEMBER in a bunch more places. 2015-02-20 00:11:42 -05:00
xml.h