@@ -443,14 +443,19 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
443
443
RangeTblEntry * * new_rte_array ;
444
444
int len ;
445
445
bool found ;
446
- int first_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
+ }
447
452
448
453
if (!pg_pathman_enable )
449
- goto original_hook ;
454
+ return ;
450
455
451
456
/* This works only for SELECT queries */
452
457
if (root -> parse -> commandType != CMD_SELECT || !inheritance_disabled )
453
- goto original_hook ;
458
+ return ;
454
459
455
460
/* Lookup partitioning information for parent relation */
456
461
prel = get_pathman_relation_info (rte -> relid ,& found );
@@ -554,18 +559,10 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
554
559
foreach (lc ,ranges )
555
560
{
556
561
IndexRange irange = lfirst_irange (lc );
557
- Oid childOid ;
558
562
559
563
for (i = irange_lower (irange );i <=irange_upper (irange );i ++ )
560
- {
561
- int idx ;
564
+ append_child_relation (root ,rel ,rti ,rte ,i ,dsm_arr [i ],wrappers );
562
565
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
- }
569
566
}
570
567
571
568
/* Clear old path list */
@@ -575,14 +572,6 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
575
572
set_append_rel_pathlist (root ,rel ,rti ,rte ,pathkeyAsc ,pathkeyDesc );
576
573
set_append_rel_size (root ,rel ,rti ,rte );
577
574
}
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
- }
586
575
}
587
576
588
577
static void