Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69db35f

Browse files
author
Oleg Tselebrovskiy
committed
Remove if(MyProc) checks in hooks
1 parented9f977 commit69db35f

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

‎pg_wait_sampling.c

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -865,13 +865,9 @@ pgws_planner_hook(Query *parse,
865865
intcursorOptions,
866866
ParamListInfoboundParams)
867867
{
868-
if (MyProc)
869-
{
870-
inti=MyProc-ProcGlobal->allProcs;
871-
if (!pgws_proc_queryids[i])
872-
pgws_proc_queryids[i]=parse->queryId;
873-
874-
}
868+
inti=MyProc-ProcGlobal->allProcs;
869+
if (!pgws_proc_queryids[i])
870+
pgws_proc_queryids[i]=parse->queryId;
875871

876872
/* Invoke original hook if needed */
877873
if (planner_hook_next)
@@ -894,14 +890,9 @@ pgws_planner_hook(Query *parse,
894890
staticvoid
895891
pgws_ExecutorStart(QueryDesc*queryDesc,inteflags)
896892
{
897-
inti;
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+
inti=MyProc-ProcGlobal->allProcs;
894+
if (!pgws_proc_queryids[i])
895+
pgws_proc_queryids[i]=queryDesc->plannedstmt->queryId;
905896

906897
if (prev_ExecutorStart)
907898
prev_ExecutorStart(queryDesc,eflags);
@@ -915,8 +906,7 @@ pgws_ExecutorStart(QueryDesc *queryDesc, int eflags)
915906
staticvoid
916907
pgws_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

921911
if (prev_ExecutorEnd)
922912
prev_ExecutorEnd(queryDesc);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp