Re: jsonb access operators inefficiency - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: jsonb access operators inefficiency
Date
Msg-id 538BB3AB.5070603@dunslane.net
Whole thread Raw
In response to Re: jsonb access operators inefficiency  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 05/30/2014 01:41 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> If we're going to construct varlena objects inside a StringInfo, maybe
>> we need a proper API for it. Isn't there a danger that data member of
>> the StringInfo won't be properly aligned to allow us to do this? In any
>> case, we should get most of the benefit of your patch without this
>> "optimization".
> As noted, the data buffer is maxaligned; but nonetheless I agree that
> this is a serious stylistic abuse, and it's not buying much compared
> to the rest of the patch.  I'd stick with the cstring_to_text_with_len
> coding.
>
> At the other end of the process, why are we using PG_GETARG_TEXT_P
> and not PG_GETARG_TEXT_PP to avoid a "detoast" cycle on short-header
> inputs?  The function body is using VARDATA_ANY/VARSIZE_ANY_EXHDR,
> so it's already prepared for unaligned input.
>
>             


Committed with these changes.

cheers

andrew



pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Extended Prefetching using Asynchronous IO - proposal and patch
Next
From: Amit Kapila
Date:
Subject: Re: pg_sleep() doesn't work well with recovery conflict interrupts.