Re: [PATCHES] Eliminate more detoast copies for packed varlenas - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [PATCHES] Eliminate more detoast copies for packed varlenas
Date
Msg-id 46F6659E.80501@dunslane.net
Whole thread Raw
In response to Re: [PATCHES] Eliminate more detoast copies for packed varlenas  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers

Gregory Stark wrote:
> "Tom Lane" <tgl@sss.pgh.pa.us> writes:
>
>   
>> Gregory Stark <stark@enterprisedb.com> writes:
>>     
>>> Ok, this removes what should be most if not all of the call sites where we're
>>> detoasting text or byteas. In particular it gets all the regexp/like functions
>>> and all the trim/pad functions. It also gets hashtext and hash_any.
>>>       
>> Applied with some fixes --- you'd missed like_match.c, which doubtless
>> explains Guillame's complaint that it didn't work ...
>>     
>
> Strange. It passed all regression tests for me and it seems like this is
> something that would have been caught even in single-byte mode by a simple
> test. It seems to me that like_match.c only used for SIMILAR is that right?
> That would explain it as there don't appear to be any tests of SIMILAR.
>
>   

No. like_match.c contains the template for all the various incarnations 
of LIKE and ILIKE functions. It is included multiple times with 
different sets of #defines in like.c to create those functions 
(currently there are 4 of them). It also supplies the template for the 
like_escape functions, and this is where the macros are used. Those 
functions are apparently only called if there is an explicit ESCAPE 
clause. Some of our regression tests do have this, so I'm not sure what 
happened.

cheers

andrew




pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: [PATCHES] Eliminate more detoast copies for packed varlenas
Next
From: Robert Treat
Date:
Subject: Re: HOT is applied