Functional Indexes - Mailing list pgsql-sql

From David Olbersen
Subject Functional Indexes
Date
Msg-id E7E213858379814A9AE48CA6754F5ECB0D6FC9@mail01.stbernard.com
Whole thread Raw
Responses Re: Functional Indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Functional Indexes  (Joe Conway <mail@joeconway.com>)
List pgsql-sql
Hello all,

I have a function (urlhost) which finds the 'host' portion of a URL. In the case of
http://www.foobar.com/really/long/path/to/a/fileit returns "www.foobar.com". 

I also have a function (urltld) which returns the TLD of a URL. In the case of
http://www.foobar.com/really/long/path/to/a/fileit returns ".com" (the leading dot is OK). 

urltld uses urlhost to do it's job (how should be apparent).

Now the question: is there a single index I can create that will be used when my  WHERE clause contains either urlhost
orurltld? I could create two functional indexes, but that seems a bit silly to me. 

Any thoughts?

--------------------------
David Olbersen
iGuard Engineer
St. Bernard Software
11415 West Bernardo Court
San Diego, CA 92127
1-858-676-2277 x2152


pgsql-sql by date:

Previous
From: Stuart
Date:
Subject: Re: Count dates distinct within an interval
Next
From: Frank Bax
Date:
Subject: Re: Functional Indexes