aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/numeric.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2015-10-16 14:58:11 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2015-10-16 14:58:11 -0400
commit5503e6e0f32baae3e3a4e952d2c493fc20505363 (patch)
treef992b3afc8b5f19ff74f4b9aed20d18701df53d8 /src/backend/utils/adt/numeric.c
parentb00c79b5b97422e425e1feb16327d3eba5fcd228 (diff)
downloadpostgresql-5503e6e0f32baae3e3a4e952d2c493fc20505363.tar.gz
postgresql-5503e6e0f32baae3e3a4e952d2c493fc20505363.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/backend/utils/adt/numeric.c')
0 files changed, 0 insertions, 0 deletions