postgresql/src
Neil Conway 3350b3740e This patch optimizes the md5_text() function (which is used to
implement the md5() SQL-level function). The old code did the
following:

1. de-toast the datum
2. convert it to a cstring via textout()
3. get the length of the cstring via strlen()

Since we are treating the datum context as a blob of binary data,
the latter two steps are unnecessary. Once the data has been
detoasted, we can just use it as-is, and derive its length from
the varlena metadata.

This patch improves some run-of-the-mill md5() computations by
just under 10% in my limited tests, and passes the regression tests.

I also noticed that md5_text() wasn't checking the return value
of md5_hash(); encountering OOM at precisely the right moment
could result in returning a random md5 hash. This patch corrects
that. A better fix would be to make md5_hash() only return on
success (and/or allocate via palloc()), but since it's used in
the frontend as well I don't see an easy way to do that.
2005-02-23 22:46:17 +00:00
..
backend This patch optimizes the md5_text() function (which is used to 2005-02-23 22:46:17 +00:00
bin Use _() macro consistently rather than gettext(). Add translation 2005-02-22 04:43:23 +00:00
corba make sure the $Id tags are converted to $PostgreSQL as well ... 2003-11-29 22:41:33 +00:00
include Use _() macro consistently rather than gettext(). Add translation 2005-02-22 04:43:23 +00:00
interfaces Use _() macro consistently rather than gettext(). Add translation 2005-02-22 04:43:23 +00:00
makefiles Revert -Wl, change to Makefile.osf, as the allegedly more standard 2005-01-06 20:56:50 +00:00
pl Un-break plpgsql build by removing unwanted _() usage. 2005-02-23 16:23:07 +00:00
port Add semicolon so snprintf.c goto has a statement to attach to: 2005-02-22 04:57:24 +00:00
template Support Sun's compiler on SunOS4 (a/k/a Solaris 9). Per ayan@ayan.net 2004-12-29 23:47:40 +00:00
test This patch changes makes some significant changes to how compilation 2005-02-22 07:18:27 +00:00
timezone Properly undef _(x) gettext macro. 2005-02-23 04:34:21 +00:00
tools Add to release checklist: 2005-02-02 16:58:52 +00:00
tutorial Adjust src/tutorial Makefile so that it can use pgxs. This allows the 2005-01-13 18:23:22 +00:00
utils PostgreSQL extension makefile framework ("pgxs"), by Fabien Coelho, with 2004-07-30 12:26:40 +00:00
bcc32.mak $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00
DEVELOPERS just testing a script... 1999-07-30 03:45:57 +00:00
Makefile Adjust src/tutorial Makefile so that it can use pgxs. This allows the 2005-01-13 18:23:22 +00:00
Makefile.global.in Use SHGetFolderPath instead of SHGetSpecialFolderPath to find the 2005-01-26 19:24:03 +00:00
Makefile.shlib Fix up makefile dependencies for pg_config_paths.h. 2004-11-20 21:13:06 +00:00
nls-global.mk More locale fixes for pg_ctl. 2004-06-01 03:32:42 +00:00
win32.mak $Header: -> $PostgreSQL Changes ... 2003-11-29 19:52:15 +00:00