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

Commit2561f96

Browse files
committed
small refactoring
1 parentc9f7c99 commit2561f96

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

‎pg_pathman.c

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,19 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
429429
RangeTblEntry**new_rte_array;
430430
intlen;
431431
boolfound;
432-
intfirst_child_relid=0;
432+
433+
/* Invoke original hook if needed */
434+
if (set_rel_pathlist_hook_original!=NULL)
435+
{
436+
set_rel_pathlist_hook_original(root,rel,rti,rte);
437+
}
433438

434439
if (!pg_pathman_enable)
435-
gotooriginal_hook;
440+
return;
436441

437442
/* This works only for SELECT queries */
438443
if (root->parse->commandType!=CMD_SELECT|| !inheritance_disabled)
439-
gotooriginal_hook;
444+
return;
440445

441446
/* Lookup partitioning information for parent relation */
442447
prel=get_pathman_relation_info(rte->relid,&found);
@@ -540,18 +545,10 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
540545
foreach(lc,ranges)
541546
{
542547
IndexRangeirange=lfirst_irange(lc);
543-
OidchildOid;
544548

545549
for (i=irange_lower(irange);i <=irange_upper(irange);i++)
546-
{
547-
intidx;
550+
append_child_relation(root,rel,rti,rte,i,dsm_arr[i],wrappers);
548551

549-
childOid=dsm_arr[i];
550-
idx=append_child_relation(root,rel,rti,rte,i,childOid,wrappers);
551-
552-
if (!first_child_relid)
553-
first_child_relid=idx;
554-
}
555552
}
556553

557554
/* Clear old path list */
@@ -561,14 +558,6 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
561558
set_append_rel_pathlist(root,rel,rti,rte,pathkeyAsc,pathkeyDesc);
562559
set_append_rel_size(root,rel,rti,rte);
563560
}
564-
565-
original_hook:
566-
567-
/* Invoke original hook if needed */
568-
if (set_rel_pathlist_hook_original!=NULL)
569-
{
570-
set_rel_pathlist_hook_original(root,rel,rti,rte);
571-
}
572561
}
573562

574563
staticvoid

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp