summaryrefslogtreecommitdiff
path: root/src/backend/tcop
diff options
context:
space:
mode:
authorTom Lane2024-04-03 21:41:54 +0000
committerTom Lane2024-04-03 21:41:57 +0000
commit06286709ee0637ec7376329a5aa026b7682dcfe2 (patch)
treef1c4f4b606b28227c401be2722b1d08c924586e9 /src/backend/tcop
parent97ce821e3e171ce99fa7c398889ac08432cd0264 (diff)
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/[email protected]
Diffstat (limited to 'src/backend/tcop')
-rw-r--r--src/backend/tcop/dest.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/backend/tcop/dest.c b/src/backend/tcop/dest.c
index 6d727ae24fc..96f80b30463 100644
--- a/src/backend/tcop/dest.c
+++ b/src/backend/tcop/dest.c
@@ -33,6 +33,7 @@
#include "access/xact.h"
#include "commands/copy.h"
#include "commands/createas.h"
+#include "commands/explain.h"
#include "commands/matview.h"
#include "executor/functions.h"
#include "executor/tqueue.h"
@@ -151,6 +152,9 @@ CreateDestReceiver(CommandDest dest)
case DestTupleQueue:
return CreateTupleQueueDestReceiver(NULL);
+
+ case DestExplainSerialize:
+ return CreateExplainSerializeDestReceiver(NULL);
}
/* should never get here */
@@ -186,6 +190,7 @@ EndCommand(const QueryCompletion *qc, CommandDest dest, bool force_undecorated_o
case DestSQLFunction:
case DestTransientRel:
case DestTupleQueue:
+ case DestExplainSerialize:
break;
}
}
@@ -231,6 +236,7 @@ NullCommand(CommandDest dest)
case DestSQLFunction:
case DestTransientRel:
case DestTupleQueue:
+ case DestExplainSerialize:
break;
}
}
@@ -274,6 +280,7 @@ ReadyForQuery(CommandDest dest)
case DestSQLFunction:
case DestTransientRel:
case DestTupleQueue:
+ case DestExplainSerialize:
break;
}
}