Re: JSON output from psql

From: Gurjeet Singh <gurjeet(at)singh(dot)im>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Postgres Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JSON output from psql
Date: 2020-05-13 20:14:03
Message-ID: CABwTF4XFzqTEjr9qe2trTOwmNyBRnyn1jYdT97XGw7qVO2CxXA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, May 13, 2020 at 12:50 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Mon, May 11, 2020 at 4:42 PM Gurjeet Singh <gurjeet(at)singh(dot)im> wrote:
> > That's a good point! It might still be desirable, perhaps for performance trade-off of JSON conversion on the client-side instead of on the server-side.
>
> If there's a performance problem with the server's code here, we
> should probably try to fix it, instead of adding the same feature on
> the client side.

Performance problem is not just about how much CPU/RAM is used on
server-side but other resources like network consumption to get the
results to the client. Anecdotally, I have heard of a case where
Oracle implemented custom Huffman Encoding for a customer to speed up
delivery of their resultset that contained just rows of true/false.

Arguably, delivering JSON (with its repeating attribute names in every
element of the array, dquotes and commas) is more network intensive
than converting the resultset to JSON on network side.

> But also, we shouldn't start by deciding we need feature X and then
> looking for the reason why we need it.

That's better than, or at least on par with, the excuses like "We
should do it because some other database does it, too" :-)

Best regards,
--
Gurjeet Singh http://gurjeet.singh.im/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2020-05-13 20:16:20 Re: JSON output from psql
Previous Message Ranier Vilela 2020-05-13 20:08:39 Re: SLRU statistics