Re: SendRowDescriptionMessage() is slow for queries with a lot of columns
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Thom Brown <thom@linux.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2017-09-15T18:23:11Z
Lists: pgsql-hackers
Hi Thom, Thanks for taking a whack at this! On 2017-09-15 12:16:22 +0100, Thom Brown wrote: > I've run a fairly basic test with a table with 101 columns, selecting > a single row from the table and I get the following results: > > > Columns with 1-character names: > > master (80 jobs, 80 connections, 60 seconds): FWIW, I don't think it's useful to test this with a lot of concurrency - at that point you're likely saturating the machine with context switches etc. unless you have a lot of cores. As this is isn't related to concurrency I'd rather just check a single connection. > transaction type: /tmp/test.sql > scaling factor: 1 > query mode: simple I think you'd need to use prepared statements / -M prepared to see benefits - when parsing statements for every execution the bottleneck is elsewhere (hello O(#available_columns * #selected_columns) in colNameToVar()). Greetings, Andres Freund
Commits
-
Replace remaining uses of pq_sendint with pq_sendint{8,16,32}.
- 31079a4a8e66 11.0 landed
-
Improve performance of SendRowDescriptionMessage.
- 4c119fbcd49b 11.0 landed
-
Use one stringbuffer for all rows printed in printtup.c.
- f2dec34e19d3 11.0 landed
-
Add configure infrastructure to detect support for C99's restrict.
- 0b974dba2d6b 11.0 landed
-
Add more efficient functions to pqformat API.
- 1de09ad8eb1f 11.0 landed
-
Allow to avoid NUL-byte management for stringinfos and use in format.c.
- 70c2d1be2b1e 11.0 landed
-
Replace most usages of ntoh[ls] and hton[sl] with pg_bswap.h.
- 0ba99c84e8c7 11.0 landed
-
Extend & revamp pg_bswap.h infrastructure.
- 510b8cbff15f 11.0 landed