Bruce Momjian wrote:
Patch applied with adjustment --- the second part of your patch that
skips comparing the first byte seemed unnecessary. It seemed likely
to cause a cpu stall, so just doing the loop seemed faster.
Did you test if the second part of your patch actually caused a speedup?
In SQL that uses 'like' operator, wchareq is used to compare character.
At the head of wchareq, length of character is compared by
using pg_mblen. Therefore, pg_mblen is executed many times, and it
becomes a bottleneck.
This patch makes a short cut, and reduces execution
I forgot to attach a patch. I do post once again.
In SQL that uses 'like' operator, wchareq is used to compare characters.
At the head of wchareq, length of (multibyte) character is compared by
using pg_mblen. Therefore, pg_mblen is executed many times, and it
becomes a