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

Commitea6564c

Browse files
committed
pathman: small refactoring
1 parent8f446b9 commitea6564c

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

‎contrib/pg_pathman/pg_pathman.c

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -443,14 +443,19 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
443443
RangeTblEntry**new_rte_array;
444444
intlen;
445445
boolfound;
446-
intfirst_child_relid=0;
446+
447+
/* Invoke original hook if needed */
448+
if (set_rel_pathlist_hook_original!=NULL)
449+
{
450+
set_rel_pathlist_hook_original(root,rel,rti,rte);
451+
}
447452

448453
if (!pg_pathman_enable)
449-
gotooriginal_hook;
454+
return;
450455

451456
/* This works only for SELECT queries */
452457
if (root->parse->commandType!=CMD_SELECT|| !inheritance_disabled)
453-
gotooriginal_hook;
458+
return;
454459

455460
/* Lookup partitioning information for parent relation */
456461
prel=get_pathman_relation_info(rte->relid,&found);
@@ -554,18 +559,10 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
554559
foreach(lc,ranges)
555560
{
556561
IndexRangeirange=lfirst_irange(lc);
557-
OidchildOid;
558562

559563
for (i=irange_lower(irange);i <=irange_upper(irange);i++)
560-
{
561-
intidx;
564+
append_child_relation(root,rel,rti,rte,i,dsm_arr[i],wrappers);
562565

563-
childOid=dsm_arr[i];
564-
idx=append_child_relation(root,rel,rti,rte,i,childOid,wrappers);
565-
566-
if (!first_child_relid)
567-
first_child_relid=idx;
568-
}
569566
}
570567

571568
/* Clear old path list */
@@ -575,14 +572,6 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
575572
set_append_rel_pathlist(root,rel,rti,rte,pathkeyAsc,pathkeyDesc);
576573
set_append_rel_size(root,rel,rti,rte);
577574
}
578-
579-
original_hook:
580-
581-
/* Invoke original hook if needed */
582-
if (set_rel_pathlist_hook_original!=NULL)
583-
{
584-
set_rel_pathlist_hook_original(root,rel,rti,rte);
585-
}
586575
}
587576

588577
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp