Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id E245F476160 for ; Wed, 28 Aug 2002 04:09:12 -0400 (EDT) Received: from ferda.ied.com (xtreme10-98.aci.on.ca [209.50.81.98]) by postgresql.org (Postfix) with ESMTP id D8428476095 for ; Wed, 28 Aug 2002 04:09:03 -0400 (EDT) Received: from [127.0.0.2] (localhost.localdomain [127.0.0.1]) by ferda.ied.com (8.11.6/8.11.6) with ESMTP id g7S87r724144; Wed, 28 Aug 2002 04:07:53 -0400 Date: Wed, 28 Aug 2002 04:07:53 -0400 (EDT) From: h012@ied.com To: Josh Berkus Cc: Jeff Boes , Subject: Re: "reverse()" on strings In-Reply-To: <200208261411.01219.josh@agliodbs.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/378 X-Sequence-Number: 9224 Jeff & Josh, thanks for showing me a solution ! John PS: just curious: is there anything I can do to affect effectiveness of the cache, when ISCACHABLE is used ? (I.e. size / expiring algorithm, or order of inputs - E.g. when building the index, is there anything that would order the inputs first, to maximize cache hit/miss ratio, such as "CREATE INDEX extension_idx ON file (reverse(name)) ORDER BY name" ? On Mon, 26 Aug 2002, Josh Berkus wrote: > Jeff, h012, > > > CREATE FUNCTION fn_strrev(text) returns text as ' > > return reverse($_[0]) > > ' language 'plperl' with (iscachable); > > If you make that "WITH (ISCACHABLE, ISSTRICT)" the index will be faster to > update on columns which contain large numbers of NULLs. "ISSTRICT" refers to > the fact that if the function receives a NULL, it will output a NULL, and > thus saves the parser the time running NULLs through the function. > > Also, remember to use this index, you'll have to call the exact same function > in your queries. > > -- -- Gospel of Jesus is the saving power of God for all who believe -- ## To some, nothing is impossible. ## http://Honza.Vicherek.com/