@@ -865,13 +865,9 @@ pgws_planner_hook(Query *parse,
865865int cursorOptions ,
866866ParamListInfo boundParams )
867867{
868- if (MyProc )
869- {
870- int i = MyProc - ProcGlobal -> allProcs ;
871- if (!pgws_proc_queryids [i ])
872- pgws_proc_queryids [i ]= parse -> queryId ;
873-
874- }
868+ int i = MyProc - ProcGlobal -> allProcs ;
869+ if (!pgws_proc_queryids [i ])
870+ pgws_proc_queryids [i ]= parse -> queryId ;
875871
876872/* Invoke original hook if needed */
877873if (planner_hook_next )
@@ -894,14 +890,9 @@ pgws_planner_hook(Query *parse,
894890static void
895891pgws_ExecutorStart (QueryDesc * queryDesc ,int eflags )
896892{
897- int i ;
898-
899- if (MyProc )
900- {
901- i = MyProc - ProcGlobal -> allProcs ;
902- if (!pgws_proc_queryids [i ])
903- pgws_proc_queryids [i ]= queryDesc -> plannedstmt -> queryId ;
904- }
893+ int i = MyProc - ProcGlobal -> allProcs ;
894+ if (!pgws_proc_queryids [i ])
895+ pgws_proc_queryids [i ]= queryDesc -> plannedstmt -> queryId ;
905896
906897if (prev_ExecutorStart )
907898prev_ExecutorStart (queryDesc ,eflags );
@@ -915,8 +906,7 @@ pgws_ExecutorStart(QueryDesc *queryDesc, int eflags)
915906static void
916907pgws_ExecutorEnd (QueryDesc * queryDesc )
917908{
918- if (MyProc )
919- pgws_proc_queryids [MyProc - ProcGlobal -> allProcs ]= UINT64CONST (0 );
909+ pgws_proc_queryids [MyProc - ProcGlobal -> allProcs ]= UINT64CONST (0 );
920910
921911if (prev_ExecutorEnd )
922912prev_ExecutorEnd (queryDesc );