Fix performance bug in write_syslog(): the code to preferentially break the
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2008 22:18:18 +0000 (22:18 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 8 Jul 2008 22:18:18 +0000 (22:18 +0000)
commit73c26d50dce89221e830d9a540d79cb1aa0ee01b
tree646f9ff6c535e6fb0ed3df480c2ac734e661f253
parentc27f03b62645e183b938a34083257c43df224dab
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