Re: [PATCHES] Space management for PGresult

2005-11-24 Thread Atsushi Ogawa
Alvaro Herrera wrote: Tom Lane wrote: Atsushi Ogawa [EMAIL PROTECTED] writes: The number of malloc calls at pqResultAlloc: 8.1.0 : 80542 patched:86 Execution time: 8.1.0 : 6.80 sec patched: 6.73 sec This hardly seems worth adding any complexity for ... What

Re: [PATCHES] Space management for PGresult

2005-11-24 Thread Tom Lane
Atsushi Ogawa [EMAIL PROTECTED] writes: (1)accounts table (4 columns, 1,000,000 tuples) malloc calls allocated(bytes) unused(bytes) execution time -- 8.1.0 80,542164,950,016 2,946,402

Re: [PATCHES] Space management for PGresult

2005-11-24 Thread Simon Riggs
On Wed, 2005-11-23 at 16:21 +0900, Atsushi Ogawa wrote: In space management for PGresult of libpq, the block size of PGresult is always PGRESULT_DATA_BLOCKSIZE(2048bytes). Therefore, when a large result of query is received, malloc is executed many times. My proposal is to enlarge the size

Re: [PATCHES] Space management for PGresult

2005-11-24 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes: We really ought to be streaming the result back to the user, not downloading it all into a massive client side chunk of memory. Have you been paying any attention to the multiple previous discussions of that point? (Latest was on pgsql-interfaces within

Re: [PATCHES] [PATCH] Formatting patch for psql

2005-11-24 Thread Martijn van Oosterhout
On Thu, Nov 24, 2005 at 03:45:12PM +0100, Peter Eisentraut wrote: Martijn van Oosterhout wrote: Here is my patch to make psql handle multi-line output sanely. Instead of embedded newlines splattering your output across the screen, everything gets indented to the right column. Shouldn't

Re: [PATCHES] Space management for PGresult

2005-11-24 Thread Simon Riggs
On Thu, 2005-11-24 at 12:32 -0500, Tom Lane wrote: Simon Riggs [EMAIL PROTECTED] writes: We really ought to be streaming the result back to the user, not downloading it all into a massive client side chunk of memory. Have you been paying any attention to the multiple previous discussions

Re: [PATCHES] [PATCH] Formatting patch for psql

2005-11-24 Thread Martijn van Oosterhout
On Thu, Nov 24, 2005 at 03:45:12PM +0100, Peter Eisentraut wrote: Shouldn't you use PQmblen() to determine whether an encoding is single-byte, rather than having an enumerated list? Actually, thinking about it the answer is no. The code is relying on the fact that it's a charset that has ASCII

Re: [PATCHES] [PATCH] Formatting patch for psql

2005-11-24 Thread Peter Eisentraut
Martijn van Oosterhout wrote: On Thu, Nov 24, 2005 at 03:45:12PM +0100, Peter Eisentraut wrote: Shouldn't you use PQmblen() to determine whether an encoding is single-byte, rather than having an enumerated list? Actually, thinking about it the answer is no. The code is relying on the fact

Re: [PATCHES] [PATCH] Formatting patch for psql

2005-11-24 Thread Martijn van Oosterhout
On Thu, Nov 24, 2005 at 11:35:11PM +0100, Peter Eisentraut wrote: Martijn van Oosterhout wrote: On Thu, Nov 24, 2005 at 03:45:12PM +0100, Peter Eisentraut wrote: Shouldn't you use PQmblen() to determine whether an encoding is single-byte, rather than having an enumerated list?

Re: [PATCHES] [PATCH] Formatting patch for psql

2005-11-24 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: And what I'm saying is that you can only do that if all single byte encodings are ASCII compatable and I'm not prepared to say that... psql already assumes that; see the flex processor. So in the switch statement I listed the encodings I know