@@ -429,14 +429,19 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
429
429
RangeTblEntry * * new_rte_array ;
430
430
int len ;
431
431
bool found ;
432
- int first_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
+ }
433
438
434
439
if (!pg_pathman_enable )
435
- goto original_hook ;
440
+ return ;
436
441
437
442
/* This works only for SELECT queries */
438
443
if (root -> parse -> commandType != CMD_SELECT || !inheritance_disabled )
439
- goto original_hook ;
444
+ return ;
440
445
441
446
/* Lookup partitioning information for parent relation */
442
447
prel = get_pathman_relation_info (rte -> relid ,& found );
@@ -540,18 +545,10 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
540
545
foreach (lc ,ranges )
541
546
{
542
547
IndexRange irange = lfirst_irange (lc );
543
- Oid childOid ;
544
548
545
549
for (i = irange_lower (irange );i <=irange_upper (irange );i ++ )
546
- {
547
- int idx ;
550
+ append_child_relation (root ,rel ,rti ,rte ,i ,dsm_arr [i ],wrappers );
548
551
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
- }
555
552
}
556
553
557
554
/* Clear old path list */
@@ -561,14 +558,6 @@ pathman_set_rel_pathlist_hook(PlannerInfo *root, RelOptInfo *rel, Index rti, Ran
561
558
set_append_rel_pathlist (root ,rel ,rti ,rte ,pathkeyAsc ,pathkeyDesc );
562
559
set_append_rel_size (root ,rel ,rti ,rte );
563
560
}
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
- }
572
561
}
573
562
574
563
static void