]> granicus.if.org Git - postgresql/commit
Reimplement text_position and related functions to use Boyer-Moore-Horspool
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Sep 2008 04:20:00 +0000 (04:20 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 7 Sep 2008 04:20:00 +0000 (04:20 +0000)
commite6a310b281cdca002ba02d419d4c361f90626d99
tree62c0af6a7c42b0a5e13c6dfce3ecfe097642562b
parent2cf3f6694fc85040c1609c39ca45e7e1f05dea05
Reimplement text_position and related functions to use Boyer-Moore-Horspool
searching instead of naive matching.  In the worst case this has the same
O(M*N) complexity as the naive method, but the worst case is hard to hit,
and the average case is very fast, especially with longer patterns.

David Rowley
src/backend/utils/adt/varlena.c