Connecting Tech Pros Worldwide Help | Site Map
 
 
LinkBack Thread Tools Search this Thread
  #1  
Old November 22nd, 2005, 08:52 AM
David Garamond
Guest
 
Posts: n/a
Default functional index "real world" uses

I want to know how functional indexes are used "in the real world". Here
are the common uses:

* non-unique index on the first parts of a longish text field
(SUBSTRING(field)) to save disk space, while still allowing faster
searches than a sequential scan.

* indexing on LOWER(field)/UPPER(field) to allow case-insensitive
searches or case-insensitive unique constraint.

In what other scenario are you using functional index? Searching the
archives, I found someone indexing a date as 'YYYYMMDD', probably to
allow searching using LIKE 'YYYY%' or LIKE 'YYYYMM%'. I've also thought:

* creating a REVERSE_DOT(field) function for IP addresses and hostnames
to allow wildcard searches (*.yahoo.com) using 'REVERSE_DOT(f) LIKE
'com.yahoo.%'.

* creating a HOSTPART(field) and LOCALPART(field) for email addressess;

Has anyone done something like this or other tricks using functional
indexes? It seems potential to simplify data model (no need to store
email addresses as host + part, etc).

--
dave

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)




  #2  
Old November 22nd, 2005, 08:52 AM
Alvaro Herrera
Guest
 
Posts: n/a
Default Re: functional index "real world" uses

On Fri, Feb 06, 2004 at 12:29:07AM +0700, David Garamond wrote:
[color=blue]
> * creating a REVERSE_DOT(field) function for IP addresses and hostnames
> to allow wildcard searches (*.yahoo.com) using 'REVERSE_DOT(f) LIKE
> 'com.yahoo.%'.[/color]

I know a local telco company (hum, is this RAS syndrome?) uses this,
reversing phone numbers, so they allow search by prefix and suffix.

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Right now the sectors on the hard disk run clockwise, but I heard a rumor that
you can squeeze 0.2% more throughput by running them counterclockwise.
It's worth the effort. Recommended." (Gerry Pourwelle)

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

http://archives.postgresql.org

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 205,414 network members.