pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Michael <rmichael@edgeofthenet.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Slow ext'd query via client native implementation vs. libpq & simple psql
Date: Wed, 11 Mar 2020 18:54:16 -0400
Message-ID: <6262.1583967256@sss.pgh.pa.us> (raw)
In-Reply-To: <CABR0jERv5L7U0eYyNxv3ZES9HbJj9r2KPK3_=oPMBXTbTC+oXw@mail.gmail.com>
References: <CABR0jERv5L7U0eYyNxv3ZES9HbJj9r2KPK3_=oPMBXTbTC+oXw@mail.gmail.com>

Richard Michael <rmichael@edgeofthenet.org> writes:
> On PG 12.2, I am analyzing a performance problem when using a client
> (Elixir/postgrex) querying via the extended query protocol.  I am comparing
> with
> psql and a C program.  Logs for all three follow this short explanation.

Hmm, your auto-explain log entries show all three queries having
server-side execution times of a couple dozen msec.  It seems like
the excess time must be involved in transmitting the data to the
client.  So I guess I'd be looking at whether the client is really
slow at absorbing data for some reason.

IIRC, auto-explain's 'actual time' for the top-level query node does not
count the time to format data or transmit it to the client.  Still, we
have an upper bound of ~80 msec for that to happen with the libpq client,
and there's no obvious reason why it'd be different for the other client.

[ thinks for a bit... ]  You might double check that those two clients
are using the same client_encoding setting.  400ms doing encoding
conversion seems excessive, but there aren't that many other possibilities
for the I/O time to be different.

			regards, tom lane





view thread (4+ messages)  latest in thread

Message-ID: <6262.1583967256@sss.pgh.pa.us>
Permalink:  ../6262.1583967256@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6262.1583967256@sss.pgh.pa.us

 · 

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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, rmichael@edgeofthenet.org
  Subject: Re: Slow ext'd query via client native implementation vs. libpq & simple psql
  In-Reply-To: <6262.1583967256@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