postgresql/src/include
Tom Lane 54111e9511 Don't MAXALIGN in the checks to decide whether a tuple is over TOAST's
threshold for tuple length.  On 4-byte-MAXALIGN machines, the toast code
creates tuples that have t_len exactly TOAST_TUPLE_THRESHOLD ... but this
number is not itself maxaligned, so if heap_insert maxaligns t_len before
comparing to TOAST_TUPLE_THRESHOLD, it'll uselessly recurse back to
tuptoaster.c, wasting cycles.  (It turns out that this does not happen on
8-byte-MAXALIGN machines, because for them the outer MAXALIGN in the
TOAST_MAX_CHUNK_SIZE macro reduces TOAST_MAX_CHUNK_SIZE so that toast tuples
will be less than TOAST_TUPLE_THRESHOLD in size.  That MAXALIGN is really
incorrect, but we can't remove it now, see below.)  There isn't any particular
value in maxaligning before comparing to the thresholds, so just don't do
that, which saves a small number of cycles in itself.

These numbers should be rejiggered to minimize wasted space on toast-relation
pages, but we can't do that in the back branches because changing
TOAST_MAX_CHUNK_SIZE would force an initdb (by changing the contents of toast
tables).  We can move the toast decision thresholds a bit, though, which is
what this patch effectively does.

Thanks to Pavan Deolasee for discovering the unintended recursion.

Back-patch into 8.2, but not further, pending more testing.  (HEAD is about
to get a further patch modifying the thresholds, so it won't help much
for testing this form of the patch.)
2007-02-04 20:00:49 +00:00
..
access Don't MAXALIGN in the checks to decide whether a tuple is over TOAST's 2007-02-04 20:00:49 +00:00
bootstrap pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
catalog Add a defense to prevent core dumps if 8.2 version of rank_cd() is used with 2006-12-28 01:09:04 +00:00
commands Fix recently-understood problems with handling of XID freezing, particularly 2006-11-05 22:42:10 +00:00
executor Repair failure to check that a table is still compatible with a previously 2007-02-02 00:07:28 +00:00
lib Update copyright for 2006. Update scripts. 2006-03-05 15:59:11 +00:00
libpq Fix recently-understood problems with handling of XID freezing, particularly 2006-11-05 22:42:10 +00:00
mb pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
nodes Fix failure due to accessing an already-freed tuple descriptor in a plan 2006-12-26 21:37:28 +00:00
optimizer Fix planner to do the right thing when a degenerate outer join (one whose 2006-12-12 21:31:09 +00:00
parser pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
port On Windows, use pgwin32_waitforsinglesocket() instead of select() to wait for 2007-01-26 20:07:01 +00:00
postmaster Fix recently-understood problems with handling of XID freezing, particularly 2006-11-05 22:42:10 +00:00
regex Standard pgindent run for 8.1. 2005-10-15 02:49:52 +00:00
rewrite Get rid of the separate RULE privilege for tables: now only a table's owner 2006-09-05 21:08:36 +00:00
storage Back-port changes of Jan 16 and 17 to "revoke" pending fsync requests during 2007-01-27 20:15:47 +00:00
tcop On platforms that have getrlimit(RLIMIT_STACK), use it to ensure that 2006-10-07 19:25:29 +00:00
utils Fix regex_fixed_prefix() to cope reasonably well with regex patterns of the 2007-01-03 22:39:35 +00:00
c.h Allow Borland CC to compile libpq and psql. 2007-01-11 02:40:12 +00:00
fmgr.h pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
funcapi.h pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
getaddrinfo.h pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
getopt_long.h Update copyright for 2006. Update scripts. 2006-03-05 15:59:11 +00:00
Makefile Allow installation into directories containing spaces in the name. 2005-12-09 21:19:36 +00:00
miscadmin.h Clean up local redeclarations of variables with DLLIMPORT, per report 2006-10-19 18:32:48 +00:00
pg_config.h.in Revert to the pre-8.2 method of probing for libm, that is, always 2006-11-06 03:44:38 +00:00
pg_config.h.win32 Stamp release 8.2.2. 2007-02-02 00:14:22 +00:00
pg_config_manual.h Add built-in userlock manipulation functions to replace the former 2006-09-18 22:40:40 +00:00
pg_trace.h pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
pgstat.h pgindent run for 8.2. 2006-10-04 00:30:14 +00:00
pgtime.h Fix up timetz input so that a date is required only when the specified 2006-10-18 16:43:14 +00:00
port.h Allow Borland CC to compile libpq and psql. 2007-01-11 02:40:12 +00:00
postgres.h Allow include files to compile own their own. 2006-07-13 16:49:20 +00:00
postgres_ext.h Pgindent run for 8.0. 2004-08-29 05:07:03 +00:00
postgres_fe.h Update copyright for 2006. Update scripts. 2006-03-05 15:59:11 +00:00
rusagestub.h Update copyright for 2006. Update scripts. 2006-03-05 15:59:11 +00:00