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

Commit0ea2dac

Browse files
committed
Allow learning (and predicting for) on a ForeignScan, an Append, a MergeAppend, a SubqueryScan nodes.
Tags: shardman.
1 parent7c77701 commit0ea2dac

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

‎path_utils.c‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ get_path_clauses(Path *path, PlannerInfo *root, List **selectivities)
7979
List*inner_sel=NIL;
8080
List*outer;
8181
List*outer_sel=NIL;
82-
List*cur;
82+
List*cur=NIL;
8383
List*cur_sel=NIL;
8484

8585
Assert(selectivities!=NULL);
@@ -160,6 +160,32 @@ get_path_clauses(Path *path, PlannerInfo *root, List **selectivities)
160160
returnget_path_clauses(((LimitPath*)path)->subpath,root,
161161
selectivities);
162162
break;
163+
caseT_SubqueryScanPath:
164+
returnget_path_clauses(((SubqueryScanPath*)path)->subpath,root,
165+
selectivities);
166+
break;
167+
caseT_AppendPath:
168+
{
169+
ListCell*lc;
170+
171+
foreach (lc, ((AppendPath*)path)->subpaths)
172+
{
173+
Path*subpath=lfirst(lc);
174+
175+
cur=list_concat(cur,list_copy(
176+
get_path_clauses(subpath,root,selectivities)));
177+
cur_sel=list_concat(cur_sel,*selectivities);
178+
}
179+
cur=list_concat(cur,list_copy(path->parent->baserestrictinfo));
180+
*selectivities=list_concat(cur_sel,
181+
get_selectivities(root,
182+
path->parent->baserestrictinfo,
183+
0,JOIN_INNER,NULL));
184+
returncur;
185+
}
186+
break;
187+
caseT_ForeignPath:
188+
/* The same as in the default case */
163189
default:
164190
cur=list_concat(list_copy(path->parent->baserestrictinfo),
165191
path->param_info ?

‎postprocessing.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ learnOnPlanState(PlanState *p, void *context)
252252
ctx->relidslist=list_copy(p->plan->path_relids);
253253

254254
if (p->instrument&& (p->righttree!=NULL||p->lefttree==NULL||
255-
p->plan->path_clauses!=NIL))
255+
p->plan->path_clauses!=NIL||
256+
IsA(p,ForeignScanState)||
257+
IsA(p,AppendState)||IsA(p,MergeAppendState)))
256258
{
257259
doublelearn_rows=0.;
258260
doublepredicted=0.;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp