postgresql/src/include/utils
Tom Lane ad434473eb This patch addresses some issues in TOAST compression strategy that
were discussed last year, but we felt it was too late in the 8.3 cycle to
change the code immediately.  Specifically, the patch:

* Reduces the minimum datum size to be considered for compression from
256 to 32 bytes, as suggested by Greg Stark.

* Increases the required compression rate for compressed storage from
20% to 25%, again per Greg's suggestion.

* Replaces force_input_size (size above which compression is forced)
with a maximum size to be considered for compression.  It was agreed
that allowing large inputs to escape the minimum-compression-rate
requirement was not bright, and that indeed we'd rather have a knob
that acted in the other direction.  I set this value to 1MB for the
moment, but it could use some performance studies to tune it.

* Adds an early-failure path to the compressor as suggested by Jan:
if it's been unable to find even one compressible substring in the
first 1KB (parameterizable), assume we're looking at incompressible
input and give up.  (Possibly this logic can be improved, but I'll
commit it as-is for now.)

* Improves the toasting heuristics so that when we have very large
fields with attstorage 'x' or 'e', we will push those out to toast
storage before considering inline compression of shorter fields.
This also responds to a suggestion of Greg's, though my original
proposal for a solution was a bit off base because it didn't fix
the problem for large 'e' fields.

There was some discussion in the earlier threads of exposing some
of the compression knobs to users, perhaps even on a per-column
basis.  I have not done anything about that here.  It seems to me
that if we are changing around the parameters, we'd better get some
experience and be sure we are happy with the design before we set
things in stone by providing user-visible knobs.
2008-03-07 23:20:21 +00:00
..
acl.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
array.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
ascii.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
builtins.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
cash.h Widen the money type to 64 bits. 2007-01-03 01:19:51 +00:00
catcache.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
combocid.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
date.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
datetime.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
datum.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
dynahash.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
dynamic_loader.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
elog.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
errcodes.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
flatfiles.h Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
fmgrtab.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
formatting.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
geo_decls.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
guc_tables.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
guc.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
help_config.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
hsearch.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
inet.h Change the declaration of struct varlena so that the length word is 2008-02-23 19:11:45 +00:00
int8.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
inval.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
logtape.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
lsyscache.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
memutils.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
nabstime.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
numeric.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
palloc.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
pg_crc.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
pg_locale.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
pg_lzcompress.h This patch addresses some issues in TOAST compression strategy that 2008-03-07 23:20:21 +00:00
pg_rusage.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
plancache.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
portal.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
ps_status.h Add GUC update_process_title to control whether 'ps' display is updated 2006-06-27 22:16:44 +00:00
rel.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
relcache.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
resowner.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
selfuncs.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
syscache.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
timestamp.h Replace time_t with pg_time_t (same values, but always int64) in on-disk 2008-02-17 02:09:32 +00:00
tqual.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
tuplesort.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
tuplestore.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
typcache.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
tzparser.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
uuid.h Fix some missed copyright updates. 2008-01-01 20:31:21 +00:00
varbit.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
xml.h Revise memory management for libxml calls. Instead of keeping libxml's data 2008-01-15 18:57:00 +00:00