summaryrefslogtreecommitdiffstats
path: root/searchlib/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-12-18 22:35:56 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-12-19 07:59:46 +0000
commit43dac8e093a54fe94669258591a9d2ae9f838f8c (patch)
treeeb1826ff8ac7089b946837eb6cfd09b1a2aa4c6a /searchlib/src
parent8936f5e5a97f810fc82a80d12c8ab91823120d66 (diff)
GC unused feature flags related to rollout of multithreaded fetch postings and using estimate instead of est_hits.
Diffstat (limited to 'searchlib/src')
-rw-r--r--searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/numeric_range_matcher.h7
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h2
-rw-r--r--searchlib/src/vespa/searchlib/fef/indexproperties.cpp18
-rw-r--r--searchlib/src/vespa/searchlib/fef/indexproperties.h27
-rw-r--r--searchlib/src/vespa/searchlib/fef/ranksetup.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/fef/ranksetup.h6
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/blueprint.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/blueprint.h2
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/executeinfo.h22
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h4
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp6
14 files changed, 28 insertions, 97 deletions
diff --git a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
index 2237096a06c..741a86b0beb 100644
--- a/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
+++ b/searchlib/src/tests/attribute/searchcontext/searchcontext_test.cpp
@@ -1113,7 +1113,7 @@ SearchContextTest::performRangeSearch(const VectorType & vec, const vespalib::st
{
for (size_t num_threads : {1,3}) {
vespalib::SimpleThreadBundle thread_bundle(num_threads);
- auto executeInfo = queryeval::ExecuteInfo::create(true, 1.0, vespalib::Doom::never(), thread_bundle, true, true);
+ auto executeInfo = queryeval::ExecuteInfo::create(true, 1.0, vespalib::Doom::never(), thread_bundle);
performSearch(executeInfo, vec, term, expected, TermType::WORD);
}
}
diff --git a/searchlib/src/vespa/searchlib/attribute/numeric_range_matcher.h b/searchlib/src/vespa/searchlib/attribute/numeric_range_matcher.h
index 93612fde893..7f1c3e31367 100644
--- a/searchlib/src/vespa/searchlib/attribute/numeric_range_matcher.h
+++ b/searchlib/src/vespa/searchlib/attribute/numeric_range_matcher.h
@@ -24,7 +24,8 @@ private:
int _limit;
size_t _max_per_group;
public:
- NumericRangeMatcher(const QueryTermSimple& queryTerm, bool avoidUndefinedInRange=false);
+ NumericRangeMatcher(const QueryTermSimple& queryTerm) : NumericRangeMatcher(queryTerm, false) {}
+ NumericRangeMatcher(const QueryTermSimple& queryTerm, bool avoidUndefinedInRange);
protected:
Int64Range getRange() const {
return {static_cast<int64_t>(_low), static_cast<int64_t>(_high)};
@@ -41,8 +42,8 @@ protected:
search::Range<BaseType>
cappedRange(bool isFloat)
{
- BaseType low = static_cast<BaseType>(_low);
- BaseType high = static_cast<BaseType>(_high);
+ auto low = static_cast<BaseType>(_low);
+ auto high = static_cast<BaseType>(_high);
BaseType numMin = std::numeric_limits<BaseType>::min();
BaseType numMax = std::numeric_limits<BaseType>::max();
diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h
index 83267dc4bfb..3e0794835ae 100644
--- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h
+++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.h
@@ -352,8 +352,6 @@ NumericPostingSearchContext<BaseSC, AttrT, DataT>::use_posting_lists_when_non_st
// Based on this we see that LMC = 5 * PLMC.
// The same relationship is found with the test case range_hits_ratio=[200].
- if ( ! info.create_postinglist_when_non_strict()) return false;
-
constexpr double lookup_match_constant = 5.0;
constexpr double posting_list_merge_constant = 1.0;
diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
index cd9dbff99cb..9c986d0bc63 100644
--- a/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
+++ b/searchlib/src/vespa/searchlib/fef/indexproperties.cpp
@@ -461,24 +461,6 @@ bool AlwaysMarkPhraseExpensive::check(const Properties &props, bool fallback) {
return lookupBool(props, NAME, fallback);
}
-const vespalib::string CreatePostingListWhenNonStrict::NAME("vespa.matching.create_postinglist_when_non_strict");
-const bool CreatePostingListWhenNonStrict::DEFAULT_VALUE(true);
-bool CreatePostingListWhenNonStrict::check(const Properties &props, bool fallback) {
- return lookupBool(props, NAME, fallback);
-}
-
-const vespalib::string UseEstimateForFetchPostings::NAME("vespa.matching.use_estimate_for_fetch_postings");
-const bool UseEstimateForFetchPostings::DEFAULT_VALUE(false);
-bool UseEstimateForFetchPostings::check(const Properties &props, bool fallback) {
- return lookupBool(props, NAME, fallback);
-}
-
-const vespalib::string UseThreadBundleForFetchPostings::NAME("vespa.matching.use_thread_bundle_for_fetch_postings");
-const bool UseThreadBundleForFetchPostings::DEFAULT_VALUE(false);
-bool UseThreadBundleForFetchPostings::check(const Properties &props, bool fallback) {
- return lookupBool(props, NAME, fallback);
-}
-
} // namespace matching
namespace softtimeout {
diff --git a/searchlib/src/vespa/searchlib/fef/indexproperties.h b/searchlib/src/vespa/searchlib/fef/indexproperties.h
index 0183fdf1a13..1921f52276f 100644
--- a/searchlib/src/vespa/searchlib/fef/indexproperties.h
+++ b/searchlib/src/vespa/searchlib/fef/indexproperties.h
@@ -347,33 +347,6 @@ namespace matching {
static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); }
static bool check(const Properties &props, bool fallback);
};
-
- /**
- * When enabled posting lists can be created on the fly even if iterator is not strict.
- **/
- struct CreatePostingListWhenNonStrict {
- static const vespalib::string NAME;
- static const bool DEFAULT_VALUE;
- static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); }
- static bool check(const Properties &props, bool fallback);
- };
-
- /**
- * When enabled posting lists can be created on the fly even if iterator is not strict.
- **/
- struct UseEstimateForFetchPostings {
- static const vespalib::string NAME;
- static const bool DEFAULT_VALUE;
- static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); }
- static bool check(const Properties &props, bool fallback);
- };
-
- struct UseThreadBundleForFetchPostings {
- static const vespalib::string NAME;
- static const bool DEFAULT_VALUE;
- static bool check(const Properties &props) { return check(props, DEFAULT_VALUE); }
- static bool check(const Properties &props, bool fallback);
- };
}
namespace softtimeout {
diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp
index 5c28f1814d5..d6b0b900516 100644
--- a/searchlib/src/vespa/searchlib/fef/ranksetup.cpp
+++ b/searchlib/src/vespa/searchlib/fef/ranksetup.cpp
@@ -61,9 +61,6 @@ RankSetup::RankSetup(const BlueprintFactory &factory, const IIndexEnvironment &i
_compileError(false),
_degradationAscendingOrder(false),
_always_mark_phrase_expensive(false),
- _create_postinglist_when_non_strict(true),
- _use_estimate_for_fetch_postings(false),
- _use_thread_bundle_for_fetch_postings(false),
_diversityAttribute(),
_diversityMinGroups(1),
_diversityCutoffFactor(10.0),
@@ -138,9 +135,6 @@ RankSetup::configure()
_mutateOnSummary._operation = mutate::on_summary::Operation::lookup(_indexEnv.getProperties());
_mutateAllowQueryOverride = mutate::AllowQueryOverride::check(_indexEnv.getProperties());
_always_mark_phrase_expensive = matching::AlwaysMarkPhraseExpensive::check(_indexEnv.getProperties());
- _create_postinglist_when_non_strict = matching::CreatePostingListWhenNonStrict::check(_indexEnv.getProperties());
- _use_estimate_for_fetch_postings = matching::UseEstimateForFetchPostings::check(_indexEnv.getProperties());
- _use_thread_bundle_for_fetch_postings = matching::UseThreadBundleForFetchPostings::check(_indexEnv.getProperties());
}
void
diff --git a/searchlib/src/vespa/searchlib/fef/ranksetup.h b/searchlib/src/vespa/searchlib/fef/ranksetup.h
index 04659955490..d744b38cc6e 100644
--- a/searchlib/src/vespa/searchlib/fef/ranksetup.h
+++ b/searchlib/src/vespa/searchlib/fef/ranksetup.h
@@ -70,9 +70,6 @@ private:
bool _compileError;
bool _degradationAscendingOrder;
bool _always_mark_phrase_expensive;
- bool _create_postinglist_when_non_strict;
- bool _use_estimate_for_fetch_postings;
- bool _use_thread_bundle_for_fetch_postings;
vespalib::string _diversityAttribute;
uint32_t _diversityMinGroups;
double _diversityCutoffFactor;
@@ -225,9 +222,6 @@ public:
return _degradationAscendingOrder;
}
bool always_mark_phrase_expensive() const noexcept { return _always_mark_phrase_expensive; }
- bool create_postinglist_when_non_strict() const noexcept { return _create_postinglist_when_non_strict; }
- bool use_estimate_for_fetch_postings() const noexcept { return _use_estimate_for_fetch_postings; }
- bool use_thread_bundle_for_fetch_postings() const noexcept { return _use_thread_bundle_for_fetch_postings; }
/** get number of hits to collect during graceful degradation in match phase */
uint32_t getDegradationMaxHits() const {
return _degradationMaxHits;
diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
index 71d53ade2f7..d2b4661d9c3 100644
--- a/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.cpp
@@ -527,10 +527,9 @@ IntermediateBlueprint::calculateState() const
}
double
-IntermediateBlueprint::computeNextHitRate(const Blueprint & child, double hit_rate, bool use_estimate) const
+IntermediateBlueprint::computeNextHitRate(const Blueprint & child, double hit_rate) const
{
(void) child;
- (void) use_estimate;
return hit_rate;
}
@@ -635,7 +634,7 @@ IntermediateBlueprint::fetchPostings(const ExecuteInfo &execInfo)
for (size_t i = 0; i < _children.size(); ++i) {
Blueprint & child = *_children[i];
child.fetchPostings(ExecuteInfo::create(execInfo.is_strict() && inheritStrict(i), nextHitRate, execInfo));
- nextHitRate = computeNextHitRate(child, nextHitRate, execInfo.use_estimate_for_fetch_postings());
+ nextHitRate = computeNextHitRate(child, nextHitRate);
}
}
diff --git a/searchlib/src/vespa/searchlib/queryeval/blueprint.h b/searchlib/src/vespa/searchlib/queryeval/blueprint.h
index 66d55015f62..0dbd7b618a7 100644
--- a/searchlib/src/vespa/searchlib/queryeval/blueprint.h
+++ b/searchlib/src/vespa/searchlib/queryeval/blueprint.h
@@ -354,7 +354,7 @@ private:
bool infer_want_global_filter() const;
size_t count_termwise_nodes(const UnpackInfo &unpack) const;
- virtual double computeNextHitRate(const Blueprint & child, double hit_rate, bool use_estimate) const;
+ virtual double computeNextHitRate(const Blueprint & child, double hit_rate) const;
protected:
// returns an empty collection if children have empty or
diff --git a/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp b/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp
index d8e38bc4ccc..c9ec6edb225 100644
--- a/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/executeinfo.cpp
@@ -5,11 +5,11 @@
using vespalib::Doom;
namespace search::queryeval {
-const ExecuteInfo ExecuteInfo::TRUE(true, 1.0, Doom::never(), vespalib::ThreadBundle::trivial(), true, true);
-const ExecuteInfo ExecuteInfo::FALSE(false, 1.0, Doom::never(), vespalib::ThreadBundle::trivial(), true, true);
+const ExecuteInfo ExecuteInfo::TRUE(true, 1.0, Doom::never(), vespalib::ThreadBundle::trivial());
+const ExecuteInfo ExecuteInfo::FALSE(false, 1.0, Doom::never(), vespalib::ThreadBundle::trivial());
ExecuteInfo::ExecuteInfo() noexcept
- : ExecuteInfo(false, 1.0, Doom::never(), vespalib::ThreadBundle::trivial(), true, true)
+ : ExecuteInfo(false, 1.0, Doom::never(), vespalib::ThreadBundle::trivial())
{ }
ExecuteInfo
diff --git a/searchlib/src/vespa/searchlib/queryeval/executeinfo.h b/searchlib/src/vespa/searchlib/queryeval/executeinfo.h
index fc52d3b531e..fa2c69e0400 100644
--- a/searchlib/src/vespa/searchlib/queryeval/executeinfo.h
+++ b/searchlib/src/vespa/searchlib/queryeval/executeinfo.h
@@ -15,8 +15,6 @@ class ExecuteInfo {
public:
ExecuteInfo() noexcept;
bool is_strict() const noexcept { return _strict; }
- bool create_postinglist_when_non_strict() const noexcept { return _create_postinglist_when_non_strict; }
- bool use_estimate_for_fetch_postings() const noexcept { return _use_estimate_for_fetch_postings; }
double hit_rate() const noexcept { return _hitRate; }
const vespalib::Doom & doom() const noexcept { return _doom; }
vespalib::ThreadBundle & thread_bundle() const noexcept { return _thread_bundle; }
@@ -27,37 +25,33 @@ public:
return create(strict, org._hitRate, org);
}
static ExecuteInfo create(bool strict, double hitRate, const ExecuteInfo & org) noexcept {
- return {strict, hitRate, org._doom, org.thread_bundle(), org.create_postinglist_when_non_strict(), org.use_estimate_for_fetch_postings()};
+ return {strict, hitRate, org._doom, org.thread_bundle()};
}
- static ExecuteInfo create(bool strict, double hitRate, const vespalib::Doom & doom, vespalib::ThreadBundle & thread_bundle_in,
- bool postinglist_when_non_strict, bool use_estimate_for_fetch_postings) noexcept
+ static ExecuteInfo create(bool strict, double hitRate, const vespalib::Doom & doom,
+ vespalib::ThreadBundle & thread_bundle_in) noexcept
{
- return {strict, hitRate, doom, thread_bundle_in, postinglist_when_non_strict, use_estimate_for_fetch_postings};
+ return {strict, hitRate, doom, thread_bundle_in};
}
static ExecuteInfo createForTest(bool strict) noexcept {
return createForTest(strict, 1.0);
}
static ExecuteInfo createForTest(bool strict, double hitRate) noexcept;
static ExecuteInfo createForTest(bool strict, double hitRate, const vespalib::Doom & doom) noexcept {
- return create(strict, hitRate, doom, vespalib::ThreadBundle::trivial(), true, true);
+ return create(strict, hitRate, doom, vespalib::ThreadBundle::trivial());
}
private:
- ExecuteInfo(bool strict, double hitRate_in, const vespalib::Doom & doom, vespalib::ThreadBundle & thread_bundle_in,
- bool postinglist_when_non_strict, bool use_estimate_for_fetch_postings) noexcept
+ ExecuteInfo(bool strict, double hitRate_in, const vespalib::Doom & doom,
+ vespalib::ThreadBundle & thread_bundle_in) noexcept
: _doom(doom),
_thread_bundle(thread_bundle_in),
_hitRate(hitRate_in),
- _strict(strict),
- _create_postinglist_when_non_strict(postinglist_when_non_strict),
- _use_estimate_for_fetch_postings(use_estimate_for_fetch_postings)
+ _strict(strict)
{ }
const vespalib::Doom _doom;
vespalib::ThreadBundle & _thread_bundle;
double _hitRate;
bool _strict;
- bool _create_postinglist_when_non_strict;
- bool _use_estimate_for_fetch_postings;
};
}
diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp
index 364602cba03..b6f0f5be21f 100644
--- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.cpp
@@ -300,19 +300,17 @@ AndBlueprint::createFilterSearch(bool strict, FilterConstraint constraint) const
}
double
-AndBlueprint::computeNextHitRate(const Blueprint & child, double hit_rate, bool use_estimate) const {
- double estimate = use_estimate ? child.estimate() : child.hit_ratio();
- return hit_rate * estimate;
+AndBlueprint::computeNextHitRate(const Blueprint & child, double hit_rate) const {
+ return hit_rate * child.estimate();
}
double
-OrBlueprint::computeNextHitRate(const Blueprint & child, double hit_rate, bool use_estimate) const {
+OrBlueprint::computeNextHitRate(const Blueprint & child, double hit_rate) const {
// Avoid dropping hitRate to zero when meeting a conservatively high hitrate in a child.
// Happens at least when using non fast-search attributes, and with AND nodes.
constexpr double MIN_INVERSE_HIT_RATIO = 0.10;
- double estimate = use_estimate ? child.estimate() : child.hit_ratio();
- double inverse_child_estimate = 1.0 - estimate;
- return (use_estimate || (inverse_child_estimate > MIN_INVERSE_HIT_RATIO))
+ double inverse_child_estimate = 1.0 - child.estimate();
+ return (inverse_child_estimate > MIN_INVERSE_HIT_RATIO)
? hit_rate * inverse_child_estimate
: hit_rate;
}
diff --git a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h
index 14672c2a5cd..cc3da6ce983 100644
--- a/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h
+++ b/searchlib/src/vespa/searchlib/queryeval/intermediate_blueprints.h
@@ -58,7 +58,7 @@ public:
SearchIterator::UP
createFilterSearch(bool strict, FilterConstraint constraint) const override;
private:
- double computeNextHitRate(const Blueprint & child, double hit_rate, bool use_estimate) const override;
+ double computeNextHitRate(const Blueprint & child, double hit_rate) const override;
};
//-----------------------------------------------------------------------------
@@ -84,7 +84,7 @@ public:
SearchIterator::UP
createFilterSearch(bool strict, FilterConstraint constraint) const override;
private:
- double computeNextHitRate(const Blueprint & child, double hit_rate, bool use_estimate) const override;
+ double computeNextHitRate(const Blueprint & child, double hit_rate) const override;
uint8_t calculate_cost_tier() const override;
};
diff --git a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp
index f0c75173671..96181377282 100644
--- a/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/same_element_blueprint.cpp
@@ -60,13 +60,11 @@ SameElementBlueprint::fetchPostings(const ExecuteInfo &execInfo)
{
if (_terms.empty()) return;
_terms[0]->fetchPostings(execInfo);
- double estimate = execInfo.use_estimate_for_fetch_postings() ? _terms[0]->hit_ratio() : _terms[0]->estimate();
- double hit_rate = execInfo.hit_rate() * estimate;
+ double hit_rate = execInfo.hit_rate() * _terms[0]->estimate();
for (size_t i = 1; i < _terms.size(); ++i) {
Blueprint & term = *_terms[i];
term.fetchPostings(ExecuteInfo::create(false, hit_rate, execInfo));
- estimate = execInfo.use_estimate_for_fetch_postings() ? _terms[0]->hit_ratio() : _terms[0]->estimate();
- hit_rate = hit_rate * estimate;
+ hit_rate = hit_rate * _terms[i]->estimate();
}
}