pgsql: Improve performance of fixempties() pass in regular-expression c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Improve performance of fixempties() pass in regular-expression c
Дата
Msg-id E1ZnB7A-0005hq-8J@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/8cf4eed0b0f25063e3d09933cf7334cc95094307

Modified Files
--------------
src/backend/regex/regc_nfa.c |  249 +++++++++++++++++++++---------------------
src/backend/regex/regcomp.c  |    6 +-
2 files changed, 128 insertions(+), 127 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Improve memory-usage accounting in regular-expression compiler.
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Allow a parallel context to relaunch workers.