Does pgsql's regex processor optimize Common-Prefix? - Mailing list pgsql-general

From Kurapica
Subject Does pgsql's regex processor optimize Common-Prefix?
Date
Msg-id 480b46a10612231134j6c79e08dib949291b947e5107@mail.gmail.com
Whole thread Raw
Responses Re: Does pgsql's regex processor optimize Common-Prefix?  (Alvaro Herrera <alvherre@commandprompt.com>)
List pgsql-general
Hi all.
I am developing an application which searches for city names in a
column. There is a lot of cities and I have to 'like' every name which
is not effective enough. So I want to know whether pgsql's regex
processor can optimize regexes such as:

Nebraska|Nevada|North Carolina
to
N(e(braska|vada)|orth Carolina)

If the processor can do that like a Dictionary-Tree, it may be
affordable to me or else I have to write a matcher myself.

Any suggestion is appreciated. Thank you and appologize for my poor English.

--Xig

pgsql-general by date:

Previous
From: Benjamin Arai
Date:
Subject: Re: Problem with large table not using indexes (I think)
Next
From: Vlad
Date:
Subject: seeking for suggestions - sporadic performance degradation