Skip site navigation (1) Skip section navigation (2)

Re: Does pgsql's regex processor optimize Common-Prefix?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Kurapica <kurapica(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Does pgsql's regex processor optimize Common-Prefix?
Date: 2006-12-26 12:11:51
Message-ID: 20061226121151.GB5783@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-general
Kurapica wrote:

> 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.

Compared to the use of indexes to skip whole table scanning, this
optimization is going to have very little impact.  So don't worry about
it.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

pgsql-general by date

Next:From: Oleg BartunovDate: 2006-12-26 12:18:47
Subject: Re: Does pgsql's regex processor optimize Common-Prefix?
Previous:From: Martijn van OosterhoutDate: 2006-12-26 11:53:48
Subject: Re: NEED URGENT HELP....

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group