Re: "reverse()" on strings - Mailing list pgsql-sql

From Josh Berkus
Subject Re: "reverse()" on strings
Date
Msg-id 200208261411.01219.josh@agliodbs.com
Whole thread Raw
In response to Re: "reverse()" on strings  (Jeff Boes <jboes@nexcerpt.com>)
Responses Re: "reverse()" on strings
List pgsql-sql
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.

--
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: Jeff Boes
Date:
Subject: Re: "reverse()" on strings
Next
From: Bruce Momjian
Date:
Subject: Re: Efficient DELETE Strategies