From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@postgresql.org, Noah Misch <noah@leadboat.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Improve performance of SendRowDescriptionMessage.
Date: Fri, 13 Oct 2017 11:26:35 -0400
Message-ID: <21773.1507908395@sss.pgh.pa.us> (raw)
In-Reply-To: <20171013070247.GA505228@rfd.leadboat.com>
References: <E1e2RML-0002do-Lc@gemulon.postgresql.org>
<307.1507819498@sss.pgh.pa.us>
<20171012230844.ye4tnye2shysvqpk@alap3.anarazel.de>
<20171013023536.GA492146@rfd.leadboat.com>
<12267.1507862660@sss.pgh.pa.us>
<20171013070247.GA505228@rfd.leadboat.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Noah Misch <noah@leadboat.com> writes:
> I hacked psql to call PQtrace() and ran "psql -Xc 'select true'" in the
> defective configuration and in a working x64 GNU/Linux configuration. I've
> attached both PQtrace() products.
Thanks. It looks to me like the xlc build simply forgets to send some
of the T-message fields: the message length observed by the frontend
is too short, and the reported field values starting with "1140850688"
correspond to the actual contents of the subsequent D message, rather
than what should be there.
Studying the values that are returned, a plausible conclusion is that
in the sequence
pq_writestring(buf, NameStr(att->attname));
pq_writeint32(buf, resorigtbl);
pq_writeint16(buf, resorigcol);
pq_writeint32(buf, atttypid);
pq_writeint16(buf, att->attlen);
pq_writeint32(buf, atttypmod);
pq_writeint16(buf, format);
the pq_writeint32 calls are somehow becoming no-ops. That would explain
the message being exactly 12 bytes too short, and the 6 bytes that are
there match what the pq_writeint16 calls should send.
Looking at the pq_writeintN function definitions, I'm annoyed by the fact
that Andres seems to have decided whether to write sizeof(ni) or sizeof(i)
with the aid of a ouija board. That should be consistent. I'd go with
sizeof(ni) myself, since that's the object actually being memcpy'd.
It seems unlikely that that could explain this bug, but maybe somehow
sizeof() misbehaves for a parameter that's been inlined away?
Anyway, I will go make the sizeof() usages consistent, just to satisfy
my own uncontrollable neatnik-ism. Assuming that hornet stays red,
which is probable, we should disable "restrict" for that compiler.
regards, tom lane
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, noah@leadboat.com, andres@anarazel.de
Subject: Re: pgsql: Improve performance of SendRowDescriptionMessage.
In-Reply-To: <21773.1507908395@sss.pgh.pa.us>
References: <E1e2RML-0002do-Lc@gemulon.postgresql.org> <307.1507819498@sss.pgh.pa.us> <20171012230844.ye4tnye2shysvqpk@alap3.anarazel.de> <20171013023536.GA492146@rfd.leadboat.com> <12267.1507862660@sss.pgh.pa.us> <20171013070247.GA505228@rfd.leadboat.com> <21773.1507908395@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