Re: SendRowDescriptionMessage() is slow for queries with a lot of columns

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: SendRowDescriptionMessage() is slow for queries with a lot of columns
Date: 2017-10-03 07:55:22
Message-ID: 20171003075522.e7vmyuwj3gvdryot@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached is a revised version of this patchset. I'd like to get some
input on two points:

1) Does anybody have a better idea than the static buffer in
SendRowDescriptionMessage()? That's not particularly pretty, but
there's not really a convenient stringbuffer to use when called from
exec_describe_portal_message(). We could instead create a local
buffer for exec_describe_portal_message().

An alternative idea would be to have one reeusable buffer created for
each transaction command, but I'm not sure that's really better.

2) There's a lot of remaining pq_sendint() callers in other parts of the
tree. If others are ok with that, I'd do a separate pass over them.
I'd say that even after doing that, we should keep pq_sendint(),
because a lot of extension code is using that.

3) The use of restrict, with a configure based fallback, is something
we've not done before, but it's C99 and delivers significantly more
efficient code. Any arguments against?

Regards,

Andres

Attachment Content-Type Size
0001-Add-configure-infrastructure-to-detect-support-forv2.patch text/x-diff 4.1 KB
0002-Allow-to-avoid-NUL-byte-management-for-stringinfosv2.patch text/x-diff 4.7 KB
0003-Add-more-efficient-functions-to-pqformat-APIv2.patch text/x-diff 10.9 KB
0004-Use-one-stringbuffer-for-all-rows-printed-in-printv2.patch text/x-diff 3.1 KB
0005-Improve-performance-of-SendRowDescriptionMessagev2.patch text/x-diff 6.4 KB
0006-Replace-remaining-printtup-uses-of-pq_sendint-withv2.patch text/x-diff 2.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-10-03 08:06:20 Re: 64-bit queryId?
Previous Message Magnus Hagander 2017-10-03 07:38:07 Re: Possible SSL improvements for a newcomer to tackle