thomas reiss just published his follow up to my post about indexed searches in “like ‘%something'" cases.
i don't understand french so i can't tell what exactly he wrote, but i understand c code and graphs 🙂
basically – he wrote c function that does reverse() of strings, and benchmarked it against pl/pgsql and pl/perl versions. of course c version is the fastest, but just take a look at how much faster it is. and how simple it is.
I thing that this: http://translate.google.com/translate?u=http%3A%2F%2Fblog.frosties.org%2Fpost%2F2007%2F08%2F28%2FFonction-reverse-C-avec-PostgreSQL&langpair=fr%7Cen&hl=en&ie=UTF8
will help with understunging article
Hey, thanks for your article. But YOU did the tests against other implentations 😉
Thanks again!
I wonder, could that C function be included in stock postgresql ? Or is it a “pointless extension to SQL that should be avoided” ?
A string reverse is actually pretty usefull (as you demonstrated), and writing the speedy and multibyte-safe version ranks probably far too high for the average admin’s skill / available time.
@Vincent de Phily:
as for “far too high” – now the source is available on web, so it shouldn’t be a big problem.
as for including in core – talk with thomas or simply mail to pgsql-general or -hackers mailing list with suggestion.