Skip site navigation (1) Skip section navigation (2)

Re: strpos() && KMP

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Pavel Ajtkulov <ajtkulov(at)acm(dot)org>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: strpos() && KMP
Date: 2007-08-01 22:41:31
Message-ID: 46B10C1B.3060802@dunslane.net (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-patches by date

Next:From: Tom LaneDate: 2007-08-01 22:54:47
Subject: Re: Async Commit, v21 (now: v22)
Previous:From: Pavel AjtkulovDate: 2007-08-01 20:18:22
Subject: strpos() && KMP

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group