From: Andreas Joseph Krogh <andreak@officenet.no>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql@postgresql.org
Subject: Re: Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?
Date: Thu, 28 Jun 2007 17:30:35 +0200
Message-ID: <200706281730.35560.andreak@officenet.no> (raw)
In-Reply-To: <5092.1183044056@sss.pgh.pa.us>
References: <200706281630.16455.andreak@officenet.no>
<5092.1183044056@sss.pgh.pa.us>
On Thursday 28 June 2007 17:20:56 Tom Lane wrote:
> Andreas Joseph Krogh <andreak@officenet.no> writes:
> > Anybody knows if the following query will use an index-scan in PG-8.3?
> > SELECT name FROM person WHERE name LIKE 'and%';
> > I know this works in "C"-locale, but I need it with UTF-8,
>
> "C locale" and "UTF8" are entirely orthogonal things.
>
> regards, tom lane
I had the impression that LIKE-queries of type LIKE '123%' couldn't use an
index if encoding was UTF-8. I was wrong obviously. The varchar_pattern_ops
suggested by Pavel did the trick for me.
Tom: Can you comment on, very short, if the discussion on HACKERS with
title "like/ilike improvements" will improve LIKE queries like this?
Anybody knows if queries of type "LIKE '%234%'" ever will be able to use
indexes, and if someone is working on it? I'm sure I'm not the only one who
would very much appreciate it:-)
--
Andreas Joseph Krogh <andreak@officenet.no>
Senior Software Developer / Manager
------------------------+---------------------------------------------+
OfficeNet AS | The most difficult thing in the world is to |
Karenslyst Allé 11 | know how to do a thing and to watch |
PO. Box 529 Skøyen | somebody else doing it wrong, without |
0214 Oslo | comment. |
NORWAY | |
Tlf: +47 24 15 38 90 | |
Fax: +47 24 15 38 91 | |
Mobile: +47 909 56 963 | |
------------------------+---------------------------------------------+
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-sql@postgresql.org
Cc: andreak@officenet.no, tgl@sss.pgh.pa.us
Subject: Re: Is index usage in LIKE-queries with UTF-8 implemented in PG-8.3 ?
In-Reply-To: <200706281730.35560.andreak@officenet.no>
* 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