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

Started by Sean Chittendenabout 23 years ago3 messagespatches
Jump to latest
#1Sean Chittenden
sean@chittenden.org

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

Attachments:

patchtext/plain; charset=us-asciiDownload+12-51
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sean Chittenden (#1)
Re: Small perf fixes/cleanup in src/backend/utils/adt/like.c...

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

#3Sean Chittenden
sean@chittenden.org
In reply to: Tom Lane (#2)
Re: Small perf fixes/cleanup in src/backend/utils/adt/like.c...

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