[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    Re: [SQL] "reverse()" on strings
From:       h012 () ied ! com
Date:       2002-08-28 8:07:53
[Download RAW message or body]



 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/




---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic