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)
commit8cc786c87677686f964ded473e94e7822eaf39af
tree60741e309dd38064cee9cb0b314b258a326f721a
parent6923e4f4b0b4dd1f86bbd684071970121f0b0283
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