typedefstruct
{ /* current results */
uint64 processed; /* by Executor */
SPITupleTable *tuptable; /* tuptable currently being built */
/* subtransaction in which current Executor call was started */
SubTransactionId execSubid;
/* resources of this execution context */
slist_head tuptables; /* list of all live SPITupleTables */
MemoryContext procCxt; /* procedure context */
MemoryContext execCxt; /* executor context */
MemoryContext savedcxt; /* context of SPI_connect's caller */
SubTransactionId connectSubid; /* ID of connecting subtransaction */
QueryEnvironment *queryEnv; /* query environment setup for SPI level */
/* transaction management support */ bool atomic; /* atomic execution context, does not allow
* transactions */ bool internal_xact; /* SPI-managed transaction boundary, skip
* cleanup */
/* saved values of API global variables for previous nesting level */
uint64 outer_processed;
SPITupleTable *outer_tuptable; int outer_result;
} _SPI_connection;
/* *SPIplanshavethreestates:saved,unsaved,ortemporary. * *Ordinarily,the_SPI_planstructitselfaswellastheargtypesarray *areinadedicatedmemorycontextidentifiedbyplancxt(whichcanbe *reallysmall).Alltheothersubsidiarystateisinplancacheentries *identifiedbyplancache_list(note:thelistcellsthemselvesarein *plancxt). * *Inanunsavedplan,theplancxtaswellastheplancacheentries'contexts *arechildrenoftheSPIprocedurecontext,sothey'llalldisappearat *functionexit.plancache.calsoknowsthattheplancacheentriesare *"unsaved",soitdoesn'tlinkthemintoitsgloballist;hencetheydo *notrespondtoinvalevents.ThisisOKsincewearepresumablyholding *adequatelockstopreventotherbackendsfrommessingwiththetables. * *Forasavedplan,theplancxtismadeachildofCacheMemoryContext *sinceitshouldpersistuntilexplicitlydestroyed.Likewise,the *plancacheentrieswillbeunderCacheMemoryContextsincewetell *plancache.ctosavethem.Werelyonplancache.ctokeepthecache *entriesup-to-dateasneededinthefaceofinvalidationevents. * *Therearealso"temporary"SPIplans,inwhichthe_SPI_planstructis *notevenpalloc'dbutjustexistsinsomefunction'slocalvariable. *TheplancacheentriesareunsavedandexistundertheSPIexecutorcontext, *whileadditionaldatasuchasargtypesandlistcellsislooseintheSPI *executorcontext.Suchplanscanbeidentifiedbyhavingplancxt==NULL. * *Wecanalsohave"one-shot"SPIplans(whicharetypicallytemporary, *asdescribedabove).Thesearemeanttobeexecutedonceanddiscarded, *andvariousoptimizationsaremadeontheassumptionofsingleuse. *NoteinparticularthattheCachedPlanSourceswithinsuchanSPIplan *arenot"complete"untilexecution. * *Note:iftheoriginalquerystringcontainedonlywhitespaceandcomments, *theplancache_listwillbeNILandsothereisnoplacetostorethe *querystring.Wedon'tcareaboutthat,butwedocareaboutthe *argumenttypearray,whichiswhyit'sseemingly-redundantlystored.
*/ typedefstruct _SPI_plan
{ int magic; /* should equal _SPI_PLAN_MAGIC */ bool saved; /* saved or unsaved plan? */ bool oneshot; /* one-shot plan? */
List *plancache_list; /* one CachedPlanSource per parsetree */
MemoryContext plancxt; /* Context containing _SPI_plan and data */
RawParseMode parse_mode; /* raw_parser() mode */ int cursor_options; /* Cursor options used for planning */ int nargs; /* number of plan arguments */
Oid *argtypes; /* Argument types (NULL if nargs is 0) */
ParserSetupHook parserSetup; /* alternative parameter spec method */ void *parserSetupArg;
} _SPI_plan;
#endif/* SPI_PRIV_H */
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.