mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +03:00
Invent SERIALIZE option for EXPLAIN.
EXPLAIN (ANALYZE, SERIALIZE) allows collection of statistics about the volume of data emitted by a query, as well as the time taken to convert the data to the on-the-wire format. Previously there was no way to investigate this without actually sending the data to the client, in which case network transmission costs might swamp what you wanted to see. In particular this feature allows investigating the costs of de-TOASTing compressed or out-of-line data during formatting. Stepan Rutz and Matthias van de Meent, reviewed by Tomas Vondra and myself Discussion: https://postgr.es/m/ca0adb0e-fa4e-c37e-1cd7-91170b18cae1@gmx.de
This commit is contained in:
@@ -294,6 +294,9 @@ printtup_prepare_info(DR_printtup *myState, TupleDesc typeinfo, int numAttrs)
|
||||
|
||||
/* ----------------
|
||||
* printtup --- send a tuple to the client
|
||||
*
|
||||
* Note: if you change this function, see also serializeAnalyzeReceive
|
||||
* in explain.c, which is meant to replicate the computations done here.
|
||||
* ----------------
|
||||
*/
|
||||
static bool
|
||||
@@ -317,7 +320,7 @@ printtup(TupleTableSlot *slot, DestReceiver *self)
|
||||
oldcontext = MemoryContextSwitchTo(myState->tmpcontext);
|
||||
|
||||
/*
|
||||
* Prepare a DataRow message (note buffer is in per-row context)
|
||||
* Prepare a DataRow message (note buffer is in per-query context)
|
||||
*/
|
||||
pq_beginmessage_reuse(buf, 'D');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user