pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Joe Conway <mail@joeconway.com>
Cc: Nathan Bossart <nathandbossart@gmail.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Davin Shearer <davin@apache.org>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Emitting JSON to file using COPY TO
Date: Wed, 06 Dec 2023 15:20:46 -0500
Message-ID: <1136975.1701894046@sss.pgh.pa.us> (raw )
In-Reply-To: <77312d02-9325-4f14-9fe0-2746c2ee12bc@joeconway.com >
References: <cb1f118c-4698-4451-9ba9-dd8595f06c37@joeconway.com >
<926ff917-8371-40ec-b5e6-ab7b0e09bdc5@joeconway.com >
<315b81d4-4b67-7828-0355-3808cd14acd1@dunslane.net >
<7a60faf6-e7f1-419d-aee6-10a78ea2fe81@joeconway.com >
<2e7ff718-895d-83fc-46f7-be25e23b23b4@dunslane.net >
<!bbf922c5-f571-483e-a2c6-2730b02183fe@joeconway.com >
<1104915.1701877459@sss.pgh.pa.us >
<19a5f9d8-bd1f-9!e51-0f5b-510c1189a8a7@dunslane.net >
<1110690.1701880139@sss.pgh.pa.us >
<20231206163349.GA2873889@nathanxps13 >
<20231206164439.GC2873889@nathanxps13 >
<77312d02-9325-4f14-9fe0-2746c2ee12bc@joeconway.com >
Joe Conway <mail@joeconway.com> writes:
> I'll see if I can add some caching to composite_to_json(), but based on
> the relative data size it does not sound like there is much performance
> left on the table to go after, no?
If Nathan's perf results hold up elsewhere, it seems like some
micro-optimization around the text-pushing (appendStringInfoString)
might be more useful than caching. The 7% spent in cache lookups
could be worth going after later, but it's not the top of the list.
The output size difference does say that maybe we should pay some
attention to the nearby request to not always label every field.
Perhaps there should be an option for each row to transform to
a JSON array rather than an object?
regards, tom lane
view thread (163+ messages) latest in thread
Message-ID: <1136975.1701894046@sss.pgh.pa.us>
Permalink: ../1136975.1701894046@sss.pgh.pa.us/
Also on: postgresql.org/message-id/1136975.1701894046@sss.pgh.pa.us
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, mail@joeconway.com, nathandbossart@gmail.com, andrew@dunslane.net, davin@apache.org, pgsql-hackers@postgresql.org
Subject: Re: Emitting JSON to file using COPY TO
In-Reply-To: <1136975.1701894046@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox