aboutsummaryrefslogtreecommitdiff
path: root/src/include/regex/regex.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-10-16 14:58:10 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2015-10-16 15:56:00 -0400
commite9cf3dc30a4ed82f2c284240841678db15491669 (patch)
tree6597dbe0a272d1aad392cb44d6247b65081b83af /src/include/regex/regex.h
parentcff9e0659e8b79d4e075d30f04dac5a5587b8ac2 (diff)
downloadpostgresql-e9cf3dc30a4ed82f2c284240841678db15491669.tar.gz
postgresql-e9cf3dc30a4ed82f2c284240841678db15491669.zip
Improve performance of fixempties() pass in regular-expression compiler.
The previous coding took something like O(N^4) time to fully process a chain of N EMPTY arcs. We can't really do much better than O(N^2) because we have to insert about that many arcs, but we can do lots better than what's there now. The win comes partly from using mergeins() to amortize de-duplication of arcs across multiple source states, and partly from exploiting knowledge of the ordering of arcs for each state to avoid looking at arcs we don't need to consider during the scan. We do have to be a bit careful of the possible reordering of arcs introduced by the sort-merge coding of the previous commit, but that's not hard to deal with. Back-patch to all supported branches.
Diffstat (limited to 'src/include/regex/regex.h')
0 files changed, 0 insertions, 0 deletions