diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-24 14:56:35 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2012-02-24 18:40:30 -0500 |
commit | 587359479acbbdc95c8e37da40707e37097423f5 (patch) | |
tree | ff30bd279670beaf90cc78d1076f9f08b4211465 /src/backend/access/gist/gistproc.c | |
parent | 3cbfe485e44d055b9e6a27e47069729375059f8c (diff) | |
download | postgresql-587359479acbbdc95c8e37da40707e37097423f5.tar.gz postgresql-587359479acbbdc95c8e37da40707e37097423f5.zip |
Avoid repeated creation/freeing of per-subre DFAs during regex search.
In nested sub-regex trees, lower-level nodes created DFAs and then
destroyed them again before exiting, which is a bit dumb considering that
the recursive search is likely to call those nodes again later. Instead
cache each created DFA until the end of pg_regexec(). This is basically a
space for time tradeoff, in that it might increase the maximum memory
usage. However, in most regex patterns there are not all that many subre
nodes, so not that many DFAs --- and in any case, the peak usage occurs
when reaching the bottom recursion level, and except for alternation cases
that's going to be the same anyway.
Diffstat (limited to 'src/backend/access/gist/gistproc.c')
0 files changed, 0 insertions, 0 deletions