Reimplement text_position and related functions to use Boyer-Moore-Horspool
commit3b628c77d2d03500533d6cad8fab2b40d8c51fa1
authortgl <tgl>
Sun, 7 Sep 2008 04:20:00 +0000 (7 04:20 +0000)
committertgl <tgl>
Sun, 7 Sep 2008 04:20:00 +0000 (7 04:20 +0000)
treec07f1f2a3af73e6a57c12b78c3859bbbe1c8d416
parent99e43382ea5a84f2af8c12e6e3eaec3342182ab4
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