Re: strpos() && KMP - Mailing list pgsql-patches

From Andrew Dunstan
Subject Re: strpos() && KMP
Date
Msg-id 46B10C1B.3060802@dunslane.net
Whole thread Raw
In response to strpos() && KMP  (Pavel Ajtkulov <ajtkulov@acm.org>)
List pgsql-patches

Pavel Ajtkulov wrote:
> Also, I advise to use "select .. where strpos(att, 'word') > 0;" instead "select .. where attr like '%word%'"
> (strpos must be faster than regex).
>
>

The LIKE code does not use the regex engine. See
src/backend/utils/adt/like.c and like_match.c - which recently got an
efficiency makeover, especially for MB charsets (and most especially for
UTF8).

cheers

andrew

pgsql-patches by date:

Previous
From: Pavel Ajtkulov
Date:
Subject: strpos() && KMP
Next
From: Tom Lane
Date:
Subject: Re: Async Commit, v21 (now: v22)