indexable “field like ‘%something'” – update

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.

4 thoughts on “indexable “field like ‘%something'” – update”

  1. Hey, thanks for your article. But YOU did the tests against other implentations 😉
    Thanks again!

  2. 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.

  3. @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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.