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

Re: like/ilike improvements

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: andrew(at)supernews(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: like/ilike improvements
Date: 2007-05-25 03:34:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackerspgsql-patches

Tom Lane wrote:
> OK, I studied it a bit more and now see what you're driving at: in this
> form of the patch, we treat % bytewise unless it is followed by _, in
> which case we treat it char-wise.  That seems a good tradeoff,
> considering that such a pattern is probably pretty uncommon --- we
> should be willing to handle it a bit slower to simplify other cases.
> The patch seems still not right though, because you are advancing by
> bytes when \ follows %, and that isn't correct in a non-UTF8 encoding.
> The invariant we are actually insisting on here is that at the time of
> entry to MatchText(), whether initial or recursive, t and p must be
> correctly char-aligned.  I suggest the attached revision of the logic as
> a way to clarify that, and maybe save a cycle or two in the inner loop
> as well.

Good, thanks.
> Yes, I concur we needn't bother with IsFirstByte except maybe as an
> Assert.  If it is an Assert it should be up at the top of the function.

Looks like emails crossed. Glad we're on the same page. I'm away for a 
few days, so I'll attend to this next week.



In response to

pgsql-hackers by date

Next:From: Hitoshi HaradaDate: 2007-05-25 05:11:24
Subject: Why not keeping positions in GIN?
Previous:From: Andrew DunstanDate: 2007-05-25 03:21:35
Subject: Re: like/ilike improvements

pgsql-patches by date

Next:From: markDate: 2007-05-25 05:20:16
Subject: Re: like/ilike improvements
Previous:From: Andrew DunstanDate: 2007-05-25 03:21:35
Subject: Re: like/ilike improvements

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