Skip to content

Commit b5cbba7

Browse files
author
Nora Buschauer
committed
[IR][Util] Pass SearchConfiguration for heuristic search by const reference
1 parent a9cb959 commit b5cbba7

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

include/mutable/IR/HeuristicSearchPlanEnumerator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,7 @@ template<
21862186
ai::SearchConfigConcept StaticConfig
21872187
>
21882188
bool heuristic_search(PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF,
2189-
const CardinalityEstimator &CE, Search &S, ai::SearchConfiguration<StaticConfig> config);
2189+
const CardinalityEstimator &CE, Search &S, const ai::SearchConfiguration<StaticConfig> &config);
21902190

21912191
/** Computes the join order using heuristic search */
21922192
struct HeuristicSearch final : PlanEnumeratorCRTP<HeuristicSearch>

include/mutable/util/HeuristicSearch.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ struct genericAStar
727727
* @return the cost of the computed path from `initial_state` to a goal state
728728
*/
729729
const State & search(state_type initial_state, expand_type expand, heuristic_type &heuristic,
730-
SearchConfiguration<StaticConfig> config, Context&... context);
730+
const SearchConfiguration<StaticConfig> &config, Context&... context);
731731

732732
/** Resets the state of the search. */
733733
void clear() {
@@ -895,7 +895,7 @@ const State & genericAStar<State, Expand, Heuristic, StaticConfig, Context...>::
895895
state_type initial_state,
896896
expand_type expand,
897897
heuristic_type &heuristic,
898-
SearchConfiguration<StaticConfig> config,
898+
const SearchConfiguration<StaticConfig> &config,
899899
Context&... context
900900
) {
901901
if constexpr (use_weighted_search) {

src/IR/HeuristicSearchPlanEnumerator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ template<
129129
ai::SearchConfigConcept StaticConfig
130130
>
131131
bool heuristic_search(PlanTable &PT, const QueryGraph &G, const AdjacencyMatrix &M, const CostFunction &CF,
132-
const CardinalityEstimator &CE, SearchAlgorithm &S, ai::SearchConfiguration<StaticConfig> config)
132+
const CardinalityEstimator &CE, SearchAlgorithm &S,
133+
const ai::SearchConfiguration<StaticConfig> &config)
133134
{
134135
State::RESET_STATE_COUNTERS();
135136

0 commit comments

Comments
 (0)