Thread: Small perf fixes/cleanup in src/backend/utils/adt/like.c...

Small perf fixes/cleanup in src/backend/utils/adt/like.c...

From
Sean Chittenden
Date:
While doing some review of the LIKE function, I noticed some useless
bits left over from the pre-MB and converting-MB world.  These are
close to no ops, but it removes at least one function call from every
row processed by the LIKE operator, and it seemed like a slight clean
up of some #defines, which helped reduce some clutter.  If someone'd
like, I can clean this up so it's not doing a #include of a .c file,
which seemed a bit hoakey, but with least resistance as the goal, this
patch should stand alone and as it is: all regression tests pass. -sc

--
Sean Chittenden

Attachment

Re: Small perf fixes/cleanup in src/backend/utils/adt/like.c...

From
Tom Lane
Date:
Sean Chittenden <sean@chittenden.org> writes:
> While doing some review of the LIKE function, I noticed some useless
> bits left over from the pre-MB and converting-MB world.

Isn't this patch going to destroy performance in single-byte encodings?
I don't think the present state of the LIKE code is an intermediate
state --- it's exactly where we want it to be.

            regards, tom lane

Re: Small perf fixes/cleanup in src/backend/utils/adt/like.c...

From
Sean Chittenden
Date:
> > While doing some review of the LIKE function, I noticed some useless
> > bits left over from the pre-MB and converting-MB world.
>
> Isn't this patch going to destroy performance in single-byte
> encodings?  I don't think the present state of the LIKE code is an
> intermediate state --- it's exactly where we want it to be.

cpp is my friend.  I get how this was working now: didn't notice the
2nd #include "like_match.c" earlier and thought all definitions of
MatchText and MBMatchText were the same.  Tricky with the macro
expansion and redefinitions.  -sc

--
Sean Chittenden