mirror of
https://github.com/HypoPG/hypopg
synced 2026-05-24 09:38:21 +00:00
Fix pg12 compatibility wrt. 7d872c91a3f
This commit introduced a new root->append_rel_array that's setup just before we get a change to fill in the necessary data in root->append_rel_list. For now, we call setup_append_rel_array() (and free previously palloc'd memory if needed) for each hypo_injectHypotheticalPartitioning() call, but this is a waste of cycles, we'll need to call it ideally only once per query execution.
This commit is contained in:
parent
21ae10ac3c
commit
4a9adb9ca3
1 changed files with 15 additions and 0 deletions
|
|
@ -2019,6 +2019,21 @@ hypo_injectHypotheticalPartitioning(PlannerInfo *root,
|
|||
rel->pages = (BlockNumber) pages;
|
||||
rel->tuples = clamp_row_est(rel->tuples * selectivity);
|
||||
}
|
||||
|
||||
/*
|
||||
* This is done in query_planner just before add_base_rels_to_query() is
|
||||
* called, so before get_relation_info_hook is called and setup
|
||||
* root->append_rel_list
|
||||
*
|
||||
* FIXME find a way to call it once per planning and not one per
|
||||
* get_relation_info_hook call.
|
||||
*/
|
||||
if (root->append_rel_array)
|
||||
{
|
||||
pfree(root->append_rel_array);
|
||||
root->append_rel_array = NULL;
|
||||
}
|
||||
setup_append_rel_array(root);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue