X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.225.181]) by svr1.postgresql.org (Postfix) with ESMTP id 67A99CC444 for ; Tue, 15 Jul 2003 18:07:34 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr5.postgresql.org [64.117.225.181]) (amavisd-new, port 10024) with ESMTP id 72552-02 for ; Tue, 15 Jul 2003 18:07:52 +0000 (GMT) Received: from tomts24-srv.bellnexxia.net (tomts24.bellnexxia.net [209.226.175.187]) by svr1.postgresql.org (Postfix) with ESMTP id A93E7CC434 for ; Tue, 15 Jul 2003 15:07:22 -0300 (ADT) Received: from acer.sympatico.ca ([65.93.68.95]) by tomts24-srv.bellnexxia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030715180751.IAXJ23872.tomts24-srv.bellnexxia.net@acer.sympatico.ca> for ; Tue, 15 Jul 2003 14:07:51 -0400 Message-Id: <5.2.1.1.0.20030715140305.037ed940@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Tue, 15 Jul 2003 14:06:06 -0400 To: From: Frank Bax Subject: Re: Functional Indexes In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/191 X-Sequence-Number: 14305 The two functions do not group data the same way, so a common index is not possible. urlhost would put pgsql.org and pgsql.com close together. urltld would but pgsql.com and xyz.com close together. Frank At 01:36 PM 7/15/03, David Olbersen wrote: >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/file it 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/file it 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 or urltld? 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 > >---------------------------(end of broadcast)--------------------------- >TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org