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

Commit6578234

Browse files
committed
Use optimized bitmap set function for membership test in postgres_fdw
Deparsing logic in postgres_fdw for locking, FROM clause (alias) and Var(column qualification) does not need to know the exact number of membersinvolved, which can be calculated with bms_num_members(), but just ifthere is more than one relation involved, which is what bms_membership()does. The latter is more performant than the former so this shaves acouple of cycles.Author: Daniel GustafssonReviewed-by: Ashutosh Bapat, Nathan BossartDiscussion:https://postgr.es/m/C73594E0-2B67-4E10-BB35-CDE0E41CC384@yesql.se
1 parentfeced13 commit6578234

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎contrib/postgres_fdw/deparse.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,7 @@ deparseFromExpr(List *quals, deparse_expr_cxt *context)
10761076
/* Construct FROM clause */
10771077
appendStringInfoString(buf," FROM ");
10781078
deparseFromExprForRel(buf,context->root,scanrel,
1079-
(bms_num_members(scanrel->relids)>1),
1079+
(bms_membership(scanrel->relids)==BMS_MULTIPLE),
10801080
(Index)0,NULL,context->params_list);
10811081

10821082
/* Construct WHERE clause */
@@ -1262,7 +1262,7 @@ deparseLockingClause(deparse_expr_cxt *context)
12621262
}
12631263

12641264
/* Add the relation alias if we are here for a join relation */
1265-
if (bms_num_members(rel->relids)>1&&
1265+
if (bms_membership(rel->relids)==BMS_MULTIPLE&&
12661266
rc->strength!=LCS_NONE)
12671267
appendStringInfo(buf," OF %s%d",REL_ALIAS_PREFIX,relid);
12681268
}
@@ -2328,7 +2328,7 @@ deparseVar(Var *node, deparse_expr_cxt *context)
23282328
intcolno;
23292329

23302330
/* Qualify columns when multiple relations are involved. */
2331-
boolqualify_col= (bms_num_members(relids)>1);
2331+
boolqualify_col= (bms_membership(relids)==BMS_MULTIPLE);
23322332

23332333
/*
23342334
* If the Var belongs to the foreign relation that is deparsed as a

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp