summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-11-08 19:22:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-11-08 19:22:25 +0000
commita5cf12e2ef775abf4cfe7dee50d2c065047e19a0 (patch)
treecfc802a585f5878be03637912f673ce0a59c8a57 /src/backend/access/gist/gistget.c
parent9d6f26325f2ae29e45d68eaad08a28369625ffca (diff)
downloadpostgresql-a5cf12e2ef775abf4cfe7dee50d2c065047e19a0.tar.gz
Fix performance issues in replace_text(), replace_text_regexp(), and
text_to_array(): they all had O(N^2) behavior on long input strings in multibyte encodings, because of repeated rescanning of the input text to identify substrings whose positions/lengths were computed in characters instead of bytes. Fix by tracking the current source position as a char pointer as well as a character-count. Also avoid some unnecessary palloc operations. text_to_array() also leaked memory intracall due to failure to pfree temporary strings. Per gripe from Tatsuo Ishii.
Diffstat (limited to 'src/backend/access/gist/gistget.c')
0 files changed, 0 insertions, 0 deletions