Re: [SQL] "reverse()" on strings

2002-08-28 Thread h012
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 i

Re: [SQL] "reverse()" on strings

2002-08-26 Thread Josh Berkus
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 tha

Re: [SQL] "reverse()" on strings

2002-08-26 Thread Jeff Boes
On Mon, 26 Aug 2002 16:13:44 -0400, h012 wrote: > CREATE INDEX extension_idx ON file (reverse(name)); > -- but I didn't find a function called "reverse" > > CREATE INDEX extension_idx ON file (regex_match( '.*(\.[^\.]*)$' ); > -- but I didn't find a function called "regex_match" which would r

[SQL] "reverse()" on strings

2002-08-26 Thread h012
Hi, CREATE TABLE file (name varchar(255)); I have a couple of milion filenames. I need to build index based on extensions. A couple of possibilities come to mind: CREATE INDEX extension_idx ON file (reverse(name)); -- but I didn't find a function called "reverse" CREATE INDEX extension_