Re: wchareq improvement

From: a_ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: wchareq improvement
Date: 2005-05-26 14:01:37
Message-ID: PIEMIKOOMKNIJLLLBCBBKEIECHAA.a_ogawa@hi-ho.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


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?

Well, I measured the performance today. As a result, I confirmed the
second part of my patch is unnecessary as you pointed it out.
Thanks for comment and applying patch.

> a_ogawa wrote:
> >
> > 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 bottleneck.

regards,

--- Atsushi Ogawa

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-05-26 14:10:50 Re: pgsql: Add PL/pgSQL SQLSTATE and SQLERRM support which sets these values
Previous Message Peter Eisentraut 2005-05-26 10:59:51 Re: Implementation of SQLSTATE and SQLERRM variables