Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AC003475E85 for ; Mon, 26 Aug 2002 17:10:39 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id D2CC8475E41 for ; Mon, 26 Aug 2002 17:10:38 -0400 (EDT) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 1624781; Mon, 26 Aug 2002 14:10:36 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Jeff Boes , pgsql-sql@postgresql.org Subject: Re: "reverse()" on strings Date: Mon, 26 Aug 2002 14:11:01 -0700 X-Mailer: KMail [version 1.4] References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200208261411.01219.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/359 X-Sequence-Number: 9205 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= =20 update on columns which contain large numbers of NULLs. "ISSTRICT" refers = to=20 the fact that if the function receives a NULL, it will output a NULL, and= =20 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 functi= on=20 in your queries. --=20 -Josh Berkus Aglio Database Solutions San Francisco