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

Commit081c4ee

Browse files
committed
free old scan_state->cur_plans, more comments
1 parent6e7a516 commit081c4ee

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

‎pickyappend.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,21 @@ typedef struct
2424
}PreservedPlanState;
2525

2626

27+
staticvoid
28+
free_child_scan_common_array(ChildScanCommon*cur_plans,intn)
29+
{
30+
inti;
31+
32+
if (!cur_plans)
33+
return;
34+
35+
/* We shouldn't free inner objects e.g. Plans here */
36+
for (i=0;i<n;i++)
37+
pfree(cur_plans[i]);
38+
39+
pfree(cur_plans);
40+
}
41+
2742
staticvoid
2843
clear_plan_states(PickyAppendState*scan_state)
2944
{
@@ -286,8 +301,7 @@ pathman_join_pathlist_hook(PlannerInfo *root,
286301
IsA(innerrel->cheapest_total_path,AppendPath)&&
287302
(inner_prel=get_pathman_relation_info(inner_entry->relid,NULL)))
288303
{
289-
elog(LOG,"adding new path !!!");
290-
//pprint(innerrel->cheapest_total_path);
304+
elog(LOG,"adding new nestloop path with pickyappend");
291305
}
292306
elsereturn;
293307

@@ -496,12 +510,15 @@ pickyappend_rescan(CustomScanState *node)
496510

497511
parts=get_partition_oids(ranges,&nparts,prel);
498512

513+
/* Select new plans for this pass */
514+
free_child_scan_common_array(scan_state->cur_plans,scan_state->ncur_plans);
499515
scan_state->cur_plans=select_required_plans(scan_state->children,
500516
scan_state->nchildren,
501517
parts,nparts,
502518
&scan_state->ncur_plans);
503519
pfree(parts);
504520

521+
/* Transform selected plans into executable plan states */
505522
transform_plans_into_states(scan_state,
506523
scan_state->cur_plans,
507524
scan_state->ncur_plans,

‎pickyappend.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@ typedef struct
4545
List*custom_exprs;
4646
List*custom_expr_states;
4747

48+
/* All available plans */
4849
ChildScanCommon*children;
4950
intnchildren;
5051

52+
/* Currently selected plans \ plan states */
5153
ChildScanCommon*cur_plans;
5254
intncur_plans;
55+
56+
/* Index of the selected plan state */
5357
intrunning_idx;
5458

59+
/* Contains reusable PlanStates */
5560
HTAB*plan_state_table;
5661
HASHCTLplan_state_table_config;
5762
}PickyAppendState;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp