I did some profiling related to printtup() by a simple libpq "SELECT * test" program (revised from the libpq programing sample in document without retriving the results). There are 260k or so records in table test(i int).
/* original version - prepare tuple and send */ SELECT * TIMING: 0.63 sec /* Prepare but not send In printtup(): - pq_endmessage(&buf); + pfree(buf.data); + buf.data = NULL; */ SELECT * TIMING: 0.46 sec /* No prepare no send In ExecSelect(): - (*dest->receiveSlot) (slot, dest); */ SELECT * TIMING: 0.08 sec So we spend a portion of time at preparing tuples in printtup() by converting the tuple format to a network format. I am not quite familiar with that part, so I wonder is it possible to try to send with original tuple format with minimal preparing job (say handling toast) -- which might increase the amount of data of network communication, but may reduce the CPU on server side? If this is not a non-starter, I am happy to look into details, Regards, Qingqing ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly