Fix performance bug in write_syslog(): the code to preferentially break the
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2008 22:17:41 +0000 (22:17 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2008 22:17:41 +0000 (22:17 +0000)
commit3793310286546f12bfae9632c81bfaee67a913c1
treec1d3a51effc980910c5e653239d4b934dd688ee0
parentcac2f697ee21125cbe299810c8155dfb463cd7f7
Fix performance bug in write_syslog(): the code to preferentially break the
log message at newlines cost O(N^2) for very long messages with few or no
newlines.  For messages in the megabyte range this became the dominant cost.
Per gripe from Achilleas Mantzios.

Patch all the way back, since this is a safe change with no portability
risks.  I am also thinking of increasing PG_SYSLOG_LIMIT, but that should
be done separately.
src/backend/utils/error/elog.c