Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document - Mailing list pgsql-bugs

From Andres Freund
Subject Re: [BUGS] json(b)_array_elements use causes very large memory usagewhen also referencing entire json document
Date
Msg-id 20171007012252.ao64svfi3tzslhyq@alap3.anarazel.de
Whole thread Raw
In response to Re: [BUGS] json(b)_array_elements use causes very large memory usage when also referencing entire json document  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On 2017-10-06 20:51:45 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Hm. Unrelated to the topic at hand, but I wonder how much it'd take to
> > make some of the hot-path jsonb functionality tolerant of unaligned
> > datums.
> 
> Probably pretty hard given the list-of-pointers data structure inside.

Hm, it'd be a bunch of memcpy's added, that's true. But even just doing
something like that to a variant of findJsonbValueFromContainer() might
be quite rewarding.

I'm kinda wondering about treating short datums differently on platforms
that don't care much about alignment, like modern x86. It'd not take
many code changes to only do alignment copying of short datums on
platforms that care...

Greetings,

Andres Freund


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] json(b)_array_elements use causes very large memory usage when also referencing entire json document
Next
From: Jeff Janes
Date:
Subject: Re: [BUGS] BUG #14845: postgres_fdw and mysql_fdw can cause crash of instance