From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: pgsql-performance@postgresql.org
Subject: Re: LIKE without wildcard different from =
Date: Wed, 04 Aug 2010 12:41:47 -0400
Message-ID: <21079.1280940107@sss.pgh.pa.us> (raw)
In-Reply-To: <4C59503402000025000341C0@gw.wicourts.gov>
References: <4C59503402000025000341C0@gw.wicourts.gov>
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> We have been using the C locale for everything at our site, but
> there is occasionally talk of supporting characters outside the
> ASCII7 set. In playing around with indexing, to see what the impact
> of that would be, I stumbled across something which was mildly
> surprising.
> In the C locale, if you want to search for an exact value which
> doesn't contain wildcard characters, it doesn't matter whether you
> use the 'LIKE' operator or the '=' operator. With LATIN1 encoding,
> it made three orders of magnitude difference, both in the estimated
> cost and the actual run time.
What PG version are you testing? 8.4 and up should know that an
exact-match pattern can be optimized regardless of the lc_collate
setting.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov
Subject: Re: LIKE without wildcard different from =
In-Reply-To: <21079.1280940107@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox