Search Postgresql Archives

Re: longest prefix match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Em Wednesday 20 February 2008 05:55:07 Dragan Zubac escreveu:
>
> Anybody got any ideas/experiences/links for 'longest prefix match'
> solution in PostgreSQL ?
> Basically,put some telephone prefices in some kind of trie,and be able
> to perform fast lookups ?

Prefix or suffix?  

For prefix you can use "SELECT number FROM table WHERE number LIKE '123%'".

For suffix you change the "%" to the beginning of the string, but then loose 
the ability to use indices.  (Unfortunately, using suffixes is really 
interesting for caller IDs since you don't always receive area code, country 
code, etc.)

-- 
Jorge Godoy      <jgodoy@xxxxxxxxx>


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org/

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux