postgresql/src/include
Tom Lane 5f6f840e93 Reduce the alignment requirement of type "name" from int to char, and arrange
to suppress zero-padding of "name" entries in indexes.

The alignment change is unlikely to save any space, but it is really needed
anyway to make the world safe for our widespread practice of passing plain
old C strings to functions that are declared as taking Name.  In the previous
coding, the C compiler was entitled to assume that a Name pointer was
word-aligned; but we were failing to guarantee that.  I think the reason
we'd not seen failures is that usually the only thing that gets done with
such a pointer is strcmp(), which is hard to optimize in a way that exploits
word-alignment.  Still, some enterprising compiler guy will probably think
of a way eventually, or we might change our code in a way that exposes
more-obvious optimization opportunities.

The padding change is accomplished in one-liner fashion by declaring the
"name" index opclasses to use storage type "cstring" in pg_opclass.h.
Normally btree and hash don't allow a nondefault storage type, because they
don't have any provisions for converting the input datum to another type.
However, because name and cstring are effectively the same thing except for
padding, no conversion is needed --- we only need index_form_tuple() to treat
the datum as being cstring not name, and this is sufficient.  This seems to
make for about a one-third reduction in the typical sizes of system catalog
indexes that involve "name" columns, of which we have many.

These two changes are only weakly related, but the alignment change makes
me feel safer that the padding change won't introduce problems, so I'm
committing them together.
2008-06-24 17:58:27 +00:00
..
access Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
bootstrap Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
catalog Reduce the alignment requirement of type "name" from int to char, and arrange 2008-06-24 17:58:27 +00:00
commands Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
executor Move the "instr_time" typedef and associated macros into a new header 2008-05-14 19:10:29 +00:00
lib Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
libpq Code review for recent patch to terminate online backup during shutdown: 2008-04-26 22:47:40 +00:00
mb Move wchar2char() and char2wchar() from tsearch into /mb to be easier to 2008-06-18 18:42:54 +00:00
nodes Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
optimizer Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
parser Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
port Add $PostgreSQL$ markers to a lot of files that were missing them. 2008-05-17 01:28:26 +00:00
portability Add support for tracking call counts and elapsed runtime for user-defined 2008-05-15 00:17:41 +00:00
postmaster Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
regex Convert three more guc settings to enum type: 2008-04-02 14:42:56 +00:00
rewrite Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
snowball Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
storage Rewrite the sinval messaging mechanism to reduce contention and avoid 2008-06-19 21:32:56 +00:00
tcop Implement enum type for guc parameters, and convert a couple of existing 2008-03-10 12:55:13 +00:00
tsearch Improve error reporting for problems in text search configuration files 2008-06-18 20:55:42 +00:00
utils Merge duplicate upper/lower/initcap() routines in oracle_compat.c and 2008-06-23 19:27:19 +00:00
Makefile Move the "instr_time" typedef and associated macros into a new header 2008-05-14 19:10:29 +00:00
c.h Reduce the alignment requirement of type "name" from int to char, and arrange 2008-06-24 17:58:27 +00:00
fmgr.h Add support for tracking call counts and elapsed runtime for user-defined 2008-05-15 00:17:41 +00:00
funcapi.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
getaddrinfo.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
getopt_long.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
miscadmin.h Prevent shutdown in normal mode if online backup is running, and 2008-04-23 13:44:59 +00:00
pg_config.h.in Extend yesterday's patch making BLCKSZ and RELSEG_SIZE configurable to also 2008-05-02 19:52:37 +00:00
pg_config.h.win32 Provide for MSVC config equivalents of recently added configure options. Remove 2008-05-03 00:24:06 +00:00
pg_config_manual.h Reduce the alignment requirement of type "name" from int to char, and arrange 2008-06-24 17:58:27 +00:00
pg_trace.h Enable probes to work with Mac OS X Leopard and other OSes that will 2008-03-17 19:44:41 +00:00
pgstat.h Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
pgtime.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
port.h Fix rmtree() so that it keeps going after failure to remove any individual 2008-04-18 17:05:45 +00:00
postgres.h Allow float8, int8, and related datatypes to be passed by value on machines 2008-04-21 00:26:47 +00:00
postgres_ext.h Move NAMEDATALEN definition from postgres_ext.h to pg_config_manual.h. It 2007-02-06 09:16:08 +00:00
postgres_fe.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
rusagestub.h Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00