From eda04a6bcab9d03c95382ed54996412d0fc2be2c Mon Sep 17 00:00:00 2001 From: zzzxl1993 Date: Wed, 12 Mar 2025 13:22:45 +0800 Subject: [PATCH] [opt](inverted index) Enhance I/O statistics collection for the inverted index in file cache scenarios --- be/src/io/cache/block_file_cache_profile.h | 36 +++++- be/src/io/cache/cached_remote_file_reader.cpp | 15 ++- be/src/io/io_common.h | 8 +- .../query/conjunction_query.cpp | 7 +- .../inverted_index/query/conjunction_query.h | 1 + .../query/disjunction_query.cpp | 5 +- .../inverted_index/query/disjunction_query.h | 1 + .../query/phrase_edge_query.cpp | 3 +- .../inverted_index/query/phrase_edge_query.h | 1 + .../query/phrase_prefix_query.cpp | 4 +- .../inverted_index/query/phrase_query.cpp | 20 +-- .../inverted_index/query/phrase_query.h | 1 + .../inverted_index/query/prefix_query.cpp | 6 +- .../inverted_index/query/prefix_query.h | 7 +- .../inverted_index/query/regexp_query.cpp | 5 +- .../inverted_index/query/regexp_query.h | 1 + .../inverted_index/util/term_iterator.h | 16 ++- .../util/term_position_iterator.h | 14 ++- .../segment_v2/inverted_index_reader.cpp | 33 ++--- .../rowset/segment_v2/inverted_index_reader.h | 12 +- be/test/olap/inverted_index_profile_test.cpp | 71 ++++++++++- .../util/index_compaction_utils.cpp | 2 +- .../test_index_io_context.out | 114 ++++++++++++++++++ .../test_index_io_context.groovy | 46 +++++++ 24 files changed, 360 insertions(+), 69 deletions(-) diff --git a/be/src/io/cache/block_file_cache_profile.h b/be/src/io/cache/block_file_cache_profile.h index f9d9df0939f017..15ed9d0f6ebfdb 100644 --- a/be/src/io/cache/block_file_cache_profile.h +++ b/be/src/io/cache/block_file_cache_profile.h @@ -75,7 +75,6 @@ struct FileCacheProfile { struct FileCacheProfileReporter { RuntimeProfile::Counter* num_local_io_total = nullptr; RuntimeProfile::Counter* num_remote_io_total = nullptr; - RuntimeProfile::Counter* num_inverted_index_remote_io_total = nullptr; RuntimeProfile::Counter* local_io_timer = nullptr; RuntimeProfile::Counter* bytes_scanned_from_cache = nullptr; RuntimeProfile::Counter* bytes_scanned_from_remote = nullptr; @@ -89,6 +88,13 @@ struct FileCacheProfileReporter { RuntimeProfile::Counter* get_timer = nullptr; RuntimeProfile::Counter* set_timer = nullptr; + RuntimeProfile::Counter* inverted_index_num_local_io_total = nullptr; + RuntimeProfile::Counter* inverted_index_num_remote_io_total = nullptr; + RuntimeProfile::Counter* inverted_index_bytes_scanned_from_cache = nullptr; + RuntimeProfile::Counter* inverted_index_bytes_scanned_from_remote = nullptr; + RuntimeProfile::Counter* inverted_index_local_io_timer = nullptr; + RuntimeProfile::Counter* inverted_index_remote_io_timer = nullptr; + FileCacheProfileReporter(RuntimeProfile* profile) { static const char* cache_profile = "FileCache"; ADD_TIMER_WITH_LEVEL(profile, cache_profile, 1); @@ -96,8 +102,6 @@ struct FileCacheProfileReporter { cache_profile, 1); num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL(profile, "NumRemoteIOTotal", TUnit::UNIT, cache_profile, 1); - num_inverted_index_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL( - profile, "NumInvertedIndexRemoteIOTotal", TUnit::UNIT, cache_profile, 1); local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LocalIOUseTimer", cache_profile, 1); remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "RemoteIOUseTimer", cache_profile, 1); write_cache_io_timer = @@ -117,13 +121,24 @@ struct FileCacheProfileReporter { lock_wait_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "LockWaitTimer", cache_profile, 1); get_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "GetTimer", cache_profile, 1); set_timer = ADD_CHILD_TIMER_WITH_LEVEL(profile, "SetTimer", cache_profile, 1); + + inverted_index_num_local_io_total = ADD_CHILD_COUNTER_WITH_LEVEL( + profile, "InvertedIndexNumLocalIOTotal", TUnit::UNIT, cache_profile, 1); + inverted_index_num_remote_io_total = ADD_CHILD_COUNTER_WITH_LEVEL( + profile, "InvertedIndexNumRemoteIOTotal", TUnit::UNIT, cache_profile, 1); + inverted_index_bytes_scanned_from_cache = ADD_CHILD_COUNTER_WITH_LEVEL( + profile, "InvertedIndexBytesScannedFromCache", TUnit::BYTES, cache_profile, 1); + inverted_index_bytes_scanned_from_remote = ADD_CHILD_COUNTER_WITH_LEVEL( + profile, "InvertedIndexBytesScannedFromRemote", TUnit::BYTES, cache_profile, 1); + inverted_index_local_io_timer = ADD_CHILD_TIMER_WITH_LEVEL( + profile, "InvertedIndexLocalIOUseTimer", cache_profile, 1); + inverted_index_remote_io_timer = ADD_CHILD_TIMER_WITH_LEVEL( + profile, "InvertedIndexRemoteIOUseTimer", cache_profile, 1); } void update(const FileCacheStatistics* statistics) const { COUNTER_UPDATE(num_local_io_total, statistics->num_local_io_total); COUNTER_UPDATE(num_remote_io_total, statistics->num_remote_io_total); - COUNTER_UPDATE(num_inverted_index_remote_io_total, - statistics->num_inverted_index_remote_io_total); COUNTER_UPDATE(local_io_timer, statistics->local_io_timer); COUNTER_UPDATE(remote_io_timer, statistics->remote_io_timer); COUNTER_UPDATE(write_cache_io_timer, statistics->write_cache_io_timer); @@ -136,6 +151,17 @@ struct FileCacheProfileReporter { COUNTER_UPDATE(lock_wait_timer, statistics->lock_wait_timer); COUNTER_UPDATE(get_timer, statistics->get_timer); COUNTER_UPDATE(set_timer, statistics->set_timer); + + COUNTER_UPDATE(inverted_index_num_local_io_total, + statistics->inverted_index_num_local_io_total); + COUNTER_UPDATE(inverted_index_num_remote_io_total, + statistics->inverted_index_num_remote_io_total); + COUNTER_UPDATE(inverted_index_bytes_scanned_from_cache, + statistics->inverted_index_bytes_read_from_local); + COUNTER_UPDATE(inverted_index_bytes_scanned_from_remote, + statistics->inverted_index_bytes_read_from_remote); + COUNTER_UPDATE(inverted_index_local_io_timer, statistics->inverted_index_local_io_timer); + COUNTER_UPDATE(inverted_index_remote_io_timer, statistics->inverted_index_remote_io_timer); } }; diff --git a/be/src/io/cache/cached_remote_file_reader.cpp b/be/src/io/cache/cached_remote_file_reader.cpp index c7476b7ab7476c..b89bdcf2f6de0a 100644 --- a/be/src/io/cache/cached_remote_file_reader.cpp +++ b/be/src/io/cache/cached_remote_file_reader.cpp @@ -339,9 +339,6 @@ void CachedRemoteFileReader::_update_stats(const ReadStatistics& read_stats, statis->num_local_io_total++; statis->bytes_read_from_local += read_stats.bytes_read; } else { - if (is_inverted_index) { - statis->num_inverted_index_remote_io_total++; - } statis->num_remote_io_total++; statis->bytes_read_from_remote += read_stats.bytes_read; } @@ -357,6 +354,18 @@ void CachedRemoteFileReader::_update_stats(const ReadStatistics& read_stats, statis->get_timer += read_stats.get_timer; statis->set_timer += read_stats.set_timer; + if (is_inverted_index) { + if (read_stats.hit_cache) { + statis->inverted_index_num_local_io_total++; + statis->inverted_index_bytes_read_from_local += read_stats.bytes_read; + } else { + statis->inverted_index_num_remote_io_total++; + statis->inverted_index_bytes_read_from_remote += read_stats.bytes_read; + } + statis->inverted_index_local_io_timer += read_stats.local_read_timer; + statis->inverted_index_remote_io_timer += read_stats.remote_read_timer; + } + g_skip_cache_num << read_stats.skip_cache; g_skip_cache_sum << read_stats.skip_cache; } diff --git a/be/src/io/io_common.h b/be/src/io/io_common.h index d4a4e26a7c1840..33a7944f192066 100644 --- a/be/src/io/io_common.h +++ b/be/src/io/io_common.h @@ -38,7 +38,6 @@ namespace io { struct FileCacheStatistics { int64_t num_local_io_total = 0; int64_t num_remote_io_total = 0; - int64_t num_inverted_index_remote_io_total = 0; int64_t local_io_timer = 0; int64_t bytes_read_from_local = 0; int64_t bytes_read_from_remote = 0; @@ -51,6 +50,13 @@ struct FileCacheStatistics { int64_t lock_wait_timer = 0; int64_t get_timer = 0; int64_t set_timer = 0; + + int64_t inverted_index_num_local_io_total = 0; + int64_t inverted_index_num_remote_io_total = 0; + int64_t inverted_index_bytes_read_from_local = 0; + int64_t inverted_index_bytes_read_from_remote = 0; + int64_t inverted_index_local_io_timer = 0; + int64_t inverted_index_remote_io_timer = 0; }; struct IOContext { diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.cpp b/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.cpp index 083395a739e934..ce3949deb61e60 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.cpp @@ -23,7 +23,8 @@ ConjunctionQuery::ConjunctionQuery(const std::shared_ptrgetReader()->getIndexVersion()), - _conjunction_ratio(query_options.inverted_index_conjunction_opt_threshold) {} + _conjunction_ratio(query_options.inverted_index_conjunction_opt_threshold), + _io_ctx(io_ctx) {} void ConjunctionQuery::add(const InvertedIndexQueryInfo& query_info) { if (query_info.terms.empty()) { @@ -32,8 +33,8 @@ void ConjunctionQuery::add(const InvertedIndexQueryInfo& query_info) { std::vector iterators; for (const auto& term : query_info.terms) { - auto* term_doc = - TermIterator::ensure_term_doc(_searcher->getReader(), query_info.field_name, term); + auto* term_doc = TermIterator::ensure_term_doc(_io_ctx, _searcher->getReader(), + query_info.field_name, term); iterators.emplace_back(term_doc); } diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.h b/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.h index 9feb6f468a04d0..b5abc32e9fc2ae 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/conjunction_query.h @@ -44,6 +44,7 @@ class ConjunctionQuery : public Query { IndexVersion _index_version = IndexVersion::kV0; int32_t _conjunction_ratio = 1000; + const io::IOContext* _io_ctx = nullptr; bool _use_skip = false; TermIterator _lead1; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.cpp b/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.cpp index 74263c2d42a15e..645653ba318f40 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.cpp @@ -21,7 +21,7 @@ namespace doris::segment_v2 { DisjunctionQuery::DisjunctionQuery(const std::shared_ptr& searcher, const TQueryOptions& query_options, const io::IOContext* io_ctx) - : _searcher(searcher) {} + : _searcher(searcher), _io_ctx(io_ctx) {} void DisjunctionQuery::add(const InvertedIndexQueryInfo& query_info) { if (query_info.terms.empty()) { @@ -34,7 +34,8 @@ void DisjunctionQuery::add(const InvertedIndexQueryInfo& query_info) { void DisjunctionQuery::search(roaring::Roaring& roaring) { auto func = [this, &roaring](const std::string& term, bool first) { - auto* term_doc = TermIterator::ensure_term_doc(_searcher->getReader(), _field_name, term); + auto* term_doc = + TermIterator::ensure_term_doc(_io_ctx, _searcher->getReader(), _field_name, term); TermIterator iterator(term_doc); DocRange doc_range; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.h b/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.h index 3d7e5f23f8f056..5289970c9198c4 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/disjunction_query.h @@ -35,6 +35,7 @@ class DisjunctionQuery : public Query { private: std::shared_ptr _searcher; + const io::IOContext* _io_ctx = nullptr; std::wstring _field_name; std::vector _terms; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.cpp b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.cpp index 13d35a6ed23ae0..89ebdaad8ce134 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.cpp @@ -32,6 +32,7 @@ namespace doris::segment_v2 { PhraseEdgeQuery::PhraseEdgeQuery(const std::shared_ptr& searcher, const TQueryOptions& query_options, const io::IOContext* io_ctx) : _searcher(searcher), + _io_ctx(io_ctx), _query(std::make_unique()), _max_expansions(query_options.inverted_index_max_expansions) {} @@ -143,7 +144,7 @@ void PhraseEdgeQuery::find_words(const std::function& cb) { Term* term = nullptr; TermEnum* enumerator = nullptr; try { - enumerator = _searcher->getReader()->terms(); + enumerator = _searcher->getReader()->terms(nullptr, _io_ctx); while (enumerator->next()) { term = enumerator->term(); cb(term); diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.h b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.h index 4f4ebf1082b098..678b50bc9f8277 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_edge_query.h @@ -47,6 +47,7 @@ class PhraseEdgeQuery : public Query { void find_words(const std::function& cb); std::shared_ptr _searcher; + const io::IOContext* _io_ctx = nullptr; std::wstring _field_name; std::vector _terms; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_prefix_query.cpp b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_prefix_query.cpp index 1b79fdc869cfbc..c714a61bb6013f 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_prefix_query.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_prefix_query.cpp @@ -39,8 +39,8 @@ void PhrasePrefixQuery::add(const InvertedIndexQueryInfo& query_info) { std::wstring ws = StringUtil::string_to_wstring(query_info.terms[i]); terms[i].emplace_back(ws); } else { - PrefixQuery::get_prefix_terms(_searcher->getReader(), query_info.field_name, - query_info.terms[i], terms[i], _max_expansions); + _prefix_query.get_prefix_terms(_searcher->getReader(), query_info.field_name, + query_info.terms[i], terms[i], _max_expansions); if (terms[i].empty()) { std::wstring ws = StringUtil::string_to_wstring(query_info.terms[i]); terms[i].emplace_back(ws); diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.cpp b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.cpp index 3ced44974c3205..fe27123500e397 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.cpp @@ -29,7 +29,7 @@ namespace doris::segment_v2 { PhraseQuery::PhraseQuery(const std::shared_ptr& searcher, const TQueryOptions& query_options, const io::IOContext* io_ctx) - : _searcher(searcher) {} + : _searcher(searcher), _io_ctx(io_ctx) {} void PhraseQuery::add(const InvertedIndexQueryInfo& query_info) { if (query_info.terms.empty()) { @@ -38,7 +38,7 @@ void PhraseQuery::add(const InvertedIndexQueryInfo& query_info) { if (query_info.terms.size() == 1) { auto* term_pos = TermPositionIterator::ensure_term_position( - _searcher->getReader(), query_info.field_name, query_info.terms[0]); + _io_ctx, _searcher->getReader(), query_info.field_name, query_info.terms[0]); _iterators.emplace_back(std::make_shared(term_pos)); _lead1 = &_iterators.at(0); return; @@ -90,7 +90,7 @@ void PhraseQuery::init_exact_phrase_matcher(const InvertedIndexQueryInfo& query_ std::vector postings; for (size_t i = 0; i < query_info.terms.size(); i++) { const auto& term = query_info.terms[i]; - auto* term_pos = TermPositionIterator::ensure_term_position(_searcher->getReader(), + auto* term_pos = TermPositionIterator::ensure_term_position(_io_ctx, _searcher->getReader(), query_info.field_name, term); auto iter = std::make_shared(term_pos); _iterators.emplace_back(iter); @@ -106,16 +106,16 @@ void PhraseQuery::init_exact_phrase_matcher(const std::wstring& field_name, for (size_t i = 0; i < terms.size(); i++) { if (i < terms.size() - 1) { const auto& term = terms[i][0]; - auto* term_pos = TermPositionIterator::ensure_term_position(_searcher->getReader(), - field_name, term); + auto* term_pos = TermPositionIterator::ensure_term_position( + _io_ctx, _searcher->getReader(), field_name, term); auto iter = std::make_shared(term_pos); _iterators.emplace_back(iter); postings.emplace_back(iter, i); } else { std::vector subs; for (const auto& term : terms[i]) { - auto* term_pos = TermPositionIterator::ensure_term_position(_searcher->getReader(), - field_name, term); + auto* term_pos = TermPositionIterator::ensure_term_position( + _io_ctx, _searcher->getReader(), field_name, term); subs.emplace_back(term_pos); } auto iter = std::make_shared>(std::move(subs)); @@ -131,7 +131,7 @@ void PhraseQuery::init_sloppy_phrase_matcher(const InvertedIndexQueryInfo& query std::vector postings; for (size_t i = 0; i < query_info.terms.size(); i++) { const auto& term = query_info.terms[i]; - auto* term_pos = TermPositionIterator::ensure_term_position(_searcher->getReader(), + auto* term_pos = TermPositionIterator::ensure_term_position(_io_ctx, _searcher->getReader(), query_info.field_name, term); auto iter = std::make_shared(term_pos); _iterators.emplace_back(iter); @@ -147,7 +147,7 @@ void PhraseQuery::init_ordered_sloppy_phrase_matcher(const InvertedIndexQueryInf for (size_t i = 0; i < query_info.terms.size(); i++) { const auto& term = query_info.terms[i]; auto* term_pos = TermPositionIterator::ensure_term_position( - _searcher->getReader(), query_info.field_name, term); + _io_ctx, _searcher->getReader(), query_info.field_name, term); auto iter = std::make_shared(term_pos); _iterators.emplace_back(iter); postings.emplace_back(iter, i); @@ -161,7 +161,7 @@ void PhraseQuery::init_ordered_sloppy_phrase_matcher(const InvertedIndexQueryInf for (size_t i = 0; i < terms.size(); i++) { const auto& term = terms[i]; auto* term_pos = TermPositionIterator::ensure_term_position( - _searcher->getReader(), query_info.field_name, term); + _io_ctx, _searcher->getReader(), query_info.field_name, term); auto iter = std::make_shared(term_pos); postings.emplace_back(iter, i); } diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.h b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.h index 4edc2786e993b9..5080a0042260ad 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/phrase_query.h @@ -69,6 +69,7 @@ class PhraseQuery : public Query { private: std::shared_ptr _searcher; + const io::IOContext* _io_ctx = nullptr; DISI* _lead1 = nullptr; DISI* _lead2 = nullptr; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.cpp b/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.cpp index e521e632bca1c6..c05f3dd7a8bd28 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.cpp @@ -21,7 +21,7 @@ namespace doris::segment_v2 { PrefixQuery::PrefixQuery(const std::shared_ptr& searcher, const TQueryOptions& query_options, const io::IOContext* io_ctx) - : _searcher(searcher) {} + : _searcher(searcher), _io_ctx(io_ctx) {} void PrefixQuery::add(const std::wstring& field_name, const std::vector& terms) { if (terms.empty()) { @@ -30,7 +30,7 @@ void PrefixQuery::add(const std::wstring& field_name, const std::vector subs; for (const auto& ws_term : terms) { - auto* term_doc = TermPositionIterator::ensure_term_position(_searcher->getReader(), + auto* term_doc = TermPositionIterator::ensure_term_position(_io_ctx, _searcher->getReader(), field_name, ws_term); subs.emplace_back(term_doc); } @@ -50,7 +50,7 @@ void PrefixQuery::get_prefix_terms(IndexReader* reader, const std::wstring& fiel std::wstring ws_prefix = StringUtil::string_to_wstring(prefix); Term* prefix_term = _CLNEW Term(field_name.c_str(), ws_prefix.c_str()); - TermEnum* enumerator = reader->terms(prefix_term); + TermEnum* enumerator = reader->terms(prefix_term, _io_ctx); int32_t count = 0; Term* lastTerm = nullptr; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.h b/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.h index 6352f58f0401ab..597c3feebe92e6 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/prefix_query.h @@ -33,12 +33,13 @@ class PrefixQuery : public Query { void add(const std::wstring& field_name, const std::vector& terms); void search(roaring::Roaring& roaring) override; - static void get_prefix_terms(IndexReader* reader, const std::wstring& field_name, - const std::string& prefix, std::vector& prefix_terms, - int32_t max_expansions = 50); + void get_prefix_terms(IndexReader* reader, const std::wstring& field_name, + const std::string& prefix, std::vector& prefix_terms, + int32_t max_expansions = 50); private: std::shared_ptr _searcher; + const io::IOContext* _io_ctx = nullptr; UnionTermIterPtr _lead1; }; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.cpp b/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.cpp index 08db5ed411e97d..d3a446bfc43551 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.cpp @@ -29,6 +29,7 @@ namespace doris::segment_v2 { RegexpQuery::RegexpQuery(const std::shared_ptr& searcher, const TQueryOptions& query_options, const io::IOContext* io_ctx) : _searcher(searcher), + _io_ctx(io_ctx), _max_expansions(query_options.inverted_index_max_expansions), _query(searcher, query_options, io_ctx) {} @@ -129,9 +130,9 @@ void RegexpQuery::collect_matching_terms(const std::wstring& field_name, if (prefix) { std::wstring ws_prefix = StringUtil::string_to_wstring(*prefix); Term prefix(field_name.c_str(), ws_prefix.c_str()); - enumerator = _searcher->getReader()->terms(&prefix); + enumerator = _searcher->getReader()->terms(&prefix, _io_ctx); } else { - enumerator = _searcher->getReader()->terms(); + enumerator = _searcher->getReader()->terms(nullptr, _io_ctx); enumerator->next(); } do { diff --git a/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.h b/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.h index e14f2850f1b24b..3ca1765479181f 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/query/regexp_query.h @@ -47,6 +47,7 @@ class RegexpQuery : public Query { const std::optional& prefix); std::shared_ptr _searcher; + const io::IOContext* _io_ctx = nullptr; int32_t _max_expansions = 50; DisjunctionQuery _query; diff --git a/be/src/olap/rowset/segment_v2/inverted_index/util/term_iterator.h b/be/src/olap/rowset/segment_v2/inverted_index/util/term_iterator.h index 7f66ae7c4d154b..d07b448fa715bb 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/util/term_iterator.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/util/term_iterator.h @@ -25,6 +25,10 @@ CL_NS_USE(index) +namespace doris::io { +struct IOContext; +} // namespace doris::io + namespace doris::segment_v2 { class TermIterator { @@ -60,16 +64,16 @@ class TermIterator { bool read_range(DocRange* docRange) const { return term_docs_->readRange(docRange); } - static TermDocs* ensure_term_doc(IndexReader* reader, const std::wstring& field_name, - const std::string& term) { + static TermDocs* ensure_term_doc(const io::IOContext* io_ctx, IndexReader* reader, + const std::wstring& field_name, const std::string& term) { std::wstring ws_term = StringUtil::string_to_wstring(term); - return ensure_term_doc(reader, field_name, ws_term); + return ensure_term_doc(io_ctx, reader, field_name, ws_term); } - static TermDocs* ensure_term_doc(IndexReader* reader, const std::wstring& field_name, - const std::wstring& ws_term) { + static TermDocs* ensure_term_doc(const io::IOContext* io_ctx, IndexReader* reader, + const std::wstring& field_name, const std::wstring& ws_term) { auto* t = _CLNEW Term(field_name.c_str(), ws_term.c_str()); - auto* term_pos = reader->termDocs(t); + auto* term_pos = reader->termDocs(t, io_ctx); _CLDECDELETE(t); return term_pos; } diff --git a/be/src/olap/rowset/segment_v2/inverted_index/util/term_position_iterator.h b/be/src/olap/rowset/segment_v2/inverted_index/util/term_position_iterator.h index 9a9ba87f40b109..67f5d09dea3d1f 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index/util/term_position_iterator.h +++ b/be/src/olap/rowset/segment_v2/inverted_index/util/term_position_iterator.h @@ -21,6 +21,10 @@ CL_NS_USE(index) +namespace doris::io { +struct IOContext; +} // namespace doris::io + namespace doris::segment_v2 { class TermPositionIterator : public TermIterator { @@ -32,16 +36,18 @@ class TermPositionIterator : public TermIterator { int32_t next_position() const { return _term_pos->nextPosition(); } - static TermPositions* ensure_term_position(IndexReader* reader, const std::wstring& field_name, + static TermPositions* ensure_term_position(const io::IOContext* io_ctx, IndexReader* reader, + const std::wstring& field_name, const std::string& term) { std::wstring ws_term = StringUtil::string_to_wstring(term); - return ensure_term_position(reader, field_name, ws_term); + return ensure_term_position(io_ctx, reader, field_name, ws_term); } - static TermPositions* ensure_term_position(IndexReader* reader, const std::wstring& field_name, + static TermPositions* ensure_term_position(const io::IOContext* io_ctx, IndexReader* reader, + const std::wstring& field_name, const std::wstring& ws_term) { auto* t = _CLNEW Term(field_name.c_str(), ws_term.c_str()); - auto* term_pos = reader->termPositions(t); + auto* term_pos = reader->termPositions(t, io_ctx); _CLDECDELETE(t); return term_pos; } diff --git a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp index 9b91a051777468..6e57795bb8efa4 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp +++ b/be/src/olap/rowset/segment_v2/inverted_index_reader.cpp @@ -562,7 +562,7 @@ Status BkdIndexReader::construct_bkd_query_value(const void* query_value, return Status::OK(); } -Status BkdIndexReader::invoke_bkd_try_query(const void* query_value, +Status BkdIndexReader::invoke_bkd_try_query(const io::IOContext* io_ctx, const void* query_value, InvertedIndexQueryType query_type, std::shared_ptr r, uint32_t* count) { @@ -570,7 +570,7 @@ Status BkdIndexReader::invoke_bkd_try_query(const void* query_value, case InvertedIndexQueryType::LESS_THAN_QUERY: { auto visitor = std::make_unique>( - r.get(), nullptr, true); + io_ctx, r.get(), nullptr, true); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); *count = r->estimate_point_count(visitor.get()); break; @@ -578,7 +578,7 @@ Status BkdIndexReader::invoke_bkd_try_query(const void* query_value, case InvertedIndexQueryType::LESS_EQUAL_QUERY: { auto visitor = std::make_unique>( - r.get(), nullptr, true); + io_ctx, r.get(), nullptr, true); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); *count = r->estimate_point_count(visitor.get()); break; @@ -586,7 +586,7 @@ Status BkdIndexReader::invoke_bkd_try_query(const void* query_value, case InvertedIndexQueryType::GREATER_THAN_QUERY: { auto visitor = std::make_unique>( - r.get(), nullptr, true); + io_ctx, r.get(), nullptr, true); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); *count = r->estimate_point_count(visitor.get()); break; @@ -594,14 +594,14 @@ Status BkdIndexReader::invoke_bkd_try_query(const void* query_value, case InvertedIndexQueryType::GREATER_EQUAL_QUERY: { auto visitor = std::make_unique>( - r.get(), nullptr, true); + io_ctx, r.get(), nullptr, true); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); *count = r->estimate_point_count(visitor.get()); break; } case InvertedIndexQueryType::EQUAL_QUERY: { auto visitor = std::make_unique>( - r.get(), nullptr, true); + io_ctx, r.get(), nullptr, true); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); *count = r->estimate_point_count(visitor.get()); break; @@ -612,14 +612,15 @@ Status BkdIndexReader::invoke_bkd_try_query(const void* query_value, return Status::OK(); } -Status BkdIndexReader::invoke_bkd_query(const void* query_value, InvertedIndexQueryType query_type, +Status BkdIndexReader::invoke_bkd_query(const io::IOContext* io_ctx, const void* query_value, + InvertedIndexQueryType query_type, std::shared_ptr r, std::shared_ptr& bit_map) { switch (query_type) { case InvertedIndexQueryType::LESS_THAN_QUERY: { auto visitor = std::make_unique>( - r.get(), bit_map.get()); + io_ctx, r.get(), bit_map.get()); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); r->intersect(visitor.get()); break; @@ -627,7 +628,7 @@ Status BkdIndexReader::invoke_bkd_query(const void* query_value, InvertedIndexQu case InvertedIndexQueryType::LESS_EQUAL_QUERY: { auto visitor = std::make_unique>( - r.get(), bit_map.get()); + io_ctx, r.get(), bit_map.get()); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); r->intersect(visitor.get()); break; @@ -635,7 +636,7 @@ Status BkdIndexReader::invoke_bkd_query(const void* query_value, InvertedIndexQu case InvertedIndexQueryType::GREATER_THAN_QUERY: { auto visitor = std::make_unique>( - r.get(), bit_map.get()); + io_ctx, r.get(), bit_map.get()); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); r->intersect(visitor.get()); break; @@ -643,14 +644,14 @@ Status BkdIndexReader::invoke_bkd_query(const void* query_value, InvertedIndexQu case InvertedIndexQueryType::GREATER_EQUAL_QUERY: { auto visitor = std::make_unique>( - r.get(), bit_map.get()); + io_ctx, r.get(), bit_map.get()); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); r->intersect(visitor.get()); break; } case InvertedIndexQueryType::EQUAL_QUERY: { auto visitor = std::make_unique>( - r.get(), bit_map.get()); + io_ctx, r.get(), bit_map.get()); RETURN_IF_ERROR(construct_bkd_query_value(query_value, r, visitor.get())); r->intersect(visitor.get()); break; @@ -690,7 +691,7 @@ Status BkdIndexReader::try_query(const io::IOContext* io_ctx, OlapReaderStatisti return Status::OK(); } - return invoke_bkd_try_query(query_value, query_type, r, count); + return invoke_bkd_try_query(io_ctx, query_value, query_type, r, count); } catch (const CLuceneError& e) { return Status::Error( "BKD Query CLuceneError Occurred, error msg: {}", e.what()); @@ -729,7 +730,7 @@ Status BkdIndexReader::query(const io::IOContext* io_ctx, OlapReaderStatistics* return Status::OK(); } - RETURN_IF_ERROR(invoke_bkd_query(query_value, query_type, r, bit_map)); + RETURN_IF_ERROR(invoke_bkd_query(io_ctx, query_value, query_type, r, bit_map)); bit_map->runOptimize(); cache->insert(cache_key, bit_map, &cache_handler); @@ -775,9 +776,9 @@ InvertedIndexReaderType BkdIndexReader::type() { } template -InvertedIndexVisitor::InvertedIndexVisitor(lucene::util::bkd::bkd_reader* r, +InvertedIndexVisitor::InvertedIndexVisitor(const void* io_ctx, lucene::util::bkd::bkd_reader* r, roaring::Roaring* h, bool only_count) - : _hits(h), _num_hits(0), _only_count(only_count), _reader(r) {} + : _io_ctx(io_ctx), _hits(h), _num_hits(0), _only_count(only_count), _reader(r) {} template int InvertedIndexVisitor::matches(uint8_t* packed_value) { diff --git a/be/src/olap/rowset/segment_v2/inverted_index_reader.h b/be/src/olap/rowset/segment_v2/inverted_index_reader.h index 47bde84115d135..81f9c912eecd2e 100644 --- a/be/src/olap/rowset/segment_v2/inverted_index_reader.h +++ b/be/src/olap/rowset/segment_v2/inverted_index_reader.h @@ -295,6 +295,7 @@ class StringTypeInvertedIndexReader : public InvertedIndexReader { template class InvertedIndexVisitor : public lucene::util::bkd::bkd_reader::intersect_visitor { private: + const void* _io_ctx = nullptr; roaring::Roaring* _hits = nullptr; uint32_t _num_hits; bool _only_count; @@ -305,8 +306,8 @@ class InvertedIndexVisitor : public lucene::util::bkd::bkd_reader::intersect_vis std::string query_max; public: - InvertedIndexVisitor(lucene::util::bkd::bkd_reader* r, roaring::Roaring* hits, - bool only_count = false); + InvertedIndexVisitor(const void* io_ctx, lucene::util::bkd::bkd_reader* r, + roaring::Roaring* hits, bool only_count = false); ~InvertedIndexVisitor() override = default; void set_reader(lucene::util::bkd::bkd_reader* r) { _reader = r; } @@ -325,6 +326,7 @@ class InvertedIndexVisitor : public lucene::util::bkd::bkd_reader::intersect_vis std::vector& max_packed) override; lucene::util::bkd::relation compare_prefix(std::vector& prefix) override; uint32_t get_num_hits() const { return _num_hits; } + const void* get_io_context() override { return _io_ctx; } }; class BkdIndexReader : public InvertedIndexReader { @@ -348,9 +350,11 @@ class BkdIndexReader : public InvertedIndexReader { RuntimeState* runtime_state, const std::string& column_name, const void* query_value, InvertedIndexQueryType query_type, uint32_t* count) override; - Status invoke_bkd_try_query(const void* query_value, InvertedIndexQueryType query_type, + Status invoke_bkd_try_query(const io::IOContext* io_ctx, const void* query_value, + InvertedIndexQueryType query_type, std::shared_ptr r, uint32_t* count); - Status invoke_bkd_query(const void* query_value, InvertedIndexQueryType query_type, + Status invoke_bkd_query(const io::IOContext* io_ctx, const void* query_value, + InvertedIndexQueryType query_type, std::shared_ptr r, std::shared_ptr& bit_map); template diff --git a/be/test/olap/inverted_index_profile_test.cpp b/be/test/olap/inverted_index_profile_test.cpp index 25dc63588c7b16..50b14cf28829d1 100644 --- a/be/test/olap/inverted_index_profile_test.cpp +++ b/be/test/olap/inverted_index_profile_test.cpp @@ -19,12 +19,17 @@ #include -#include - -#include "olap/inverted_index_stats.h" +#include "io/cache/block_file_cache_profile.h" +#include "io/io_common.h" namespace doris { +class InvertedIndexProfileReporterTest : public testing::Test { +public: + void SetUp() {} + void TearDown() {} +}; + TEST(InvertedIndexProfileReporterTest, UpdateTest) { auto runtime_profile = std::make_unique("test_profile"); @@ -41,4 +46,64 @@ TEST(InvertedIndexProfileReporterTest, UpdateTest) { ASSERT_EQ(runtime_profile->get_counter("ExecTime_test_column2")->value(), 202); } +TEST(InvertedIndexProfileReporterTest, UpdateInvertedIndexCounters) { + auto profile = std::make_unique("test_profile"); + auto reporter = std::make_unique(profile.get()); + + io::FileCacheStatistics stats; + stats.inverted_index_num_local_io_total = 10; + stats.inverted_index_num_remote_io_total = 20; + stats.inverted_index_bytes_read_from_local = 1024; + stats.inverted_index_bytes_read_from_remote = 2048; + stats.inverted_index_local_io_timer = 100; + stats.inverted_index_remote_io_timer = 200; + + reporter->update(&stats); + + EXPECT_EQ(reporter->inverted_index_num_local_io_total->value(), 10); + EXPECT_EQ(reporter->inverted_index_num_remote_io_total->value(), 20); + EXPECT_EQ(reporter->inverted_index_bytes_scanned_from_cache->value(), 1024); + EXPECT_EQ(reporter->inverted_index_bytes_scanned_from_remote->value(), 2048); + EXPECT_EQ(reporter->inverted_index_local_io_timer->value(), 100); + EXPECT_EQ(reporter->inverted_index_remote_io_timer->value(), 200); +} + +TEST(InvertedIndexProfileReporterTest, GetInvertedIndexCountersByName) { + auto profile = std::make_unique("test_profile"); + auto reporter = std::make_unique(profile.get()); + + io::FileCacheStatistics stats; + stats.inverted_index_num_local_io_total = 5; + stats.inverted_index_num_remote_io_total = 10; + stats.inverted_index_bytes_read_from_local = 512; + stats.inverted_index_bytes_read_from_remote = 1024; + stats.inverted_index_local_io_timer = 50; + stats.inverted_index_remote_io_timer = 100; + + reporter->update(&stats); + + auto get_counter = [&](const std::string& name) { return profile->get_counter(name); }; + + auto* num_local = get_counter("InvertedIndexNumLocalIOTotal"); + auto* num_remote = get_counter("InvertedIndexNumRemoteIOTotal"); + auto* bytes_cache = get_counter("InvertedIndexBytesScannedFromCache"); + auto* bytes_remote = get_counter("InvertedIndexBytesScannedFromRemote"); + auto* local_timer = get_counter("InvertedIndexLocalIOUseTimer"); + auto* remote_timer = get_counter("InvertedIndexRemoteIOUseTimer"); + + ASSERT_NE(num_local, nullptr) << "Counter not found: InvertedIndexNumLocalIOTotal"; + ASSERT_NE(num_remote, nullptr) << "Counter not found: InvertedIndexNumRemoteIOTotal"; + ASSERT_NE(bytes_cache, nullptr) << "Counter not found: InvertedIndexBytesScannedFromCache"; + ASSERT_NE(bytes_remote, nullptr) << "Counter not found: InvertedIndexBytesScannedFromRemote"; + ASSERT_NE(local_timer, nullptr) << "Counter not found: InvertedIndexLocalIOUseTimer"; + ASSERT_NE(remote_timer, nullptr) << "Counter not found: InvertedIndexRemoteIOUseTimer"; + + EXPECT_EQ(num_local->value(), 5); + EXPECT_EQ(num_remote->value(), 10); + EXPECT_EQ(bytes_cache->value(), 512); + EXPECT_EQ(bytes_remote->value(), 1024); + EXPECT_EQ(local_timer->value(), 50); + EXPECT_EQ(remote_timer->value(), 100); +} + } // namespace doris \ No newline at end of file diff --git a/be/test/olap/rowset/segment_v2/inverted_index/compaction/util/index_compaction_utils.cpp b/be/test/olap/rowset/segment_v2/inverted_index/compaction/util/index_compaction_utils.cpp index 6ff84cb87b6660..fef30514d7daeb 100644 --- a/be/test/olap/rowset/segment_v2/inverted_index/compaction/util/index_compaction_utils.cpp +++ b/be/test/olap/rowset/segment_v2/inverted_index/compaction/util/index_compaction_utils.cpp @@ -170,7 +170,7 @@ class IndexCompactionUtils { .ok()); auto result = std::make_shared(); EXPECT_TRUE(idx_reader - ->invoke_bkd_query(query_param->get_value(), + ->invoke_bkd_query(nullptr, query_param->get_value(), InvertedIndexQueryType::EQUAL_QUERY, *bkd_searcher, result) .ok()); diff --git a/regression-test/data/fault_injection_p0/test_index_io_context.out b/regression-test/data/fault_injection_p0/test_index_io_context.out index 3dc2880233e5ef..b24411f7634b1c 100644 --- a/regression-test/data/fault_injection_p0/test_index_io_context.out +++ b/regression-test/data/fault_injection_p0/test_index_io_context.out @@ -71,3 +71,117 @@ -- !sql -- 2 +-- !sql -- +2 + +-- !sql -- +2 + +-- !sql -- +2 + +-- !sql -- +2 + +-- !sql -- +2 + +-- !sql -- +2 + +-- !sql -- +0 + +-- !sql -- +0 + +-- !sql -- +0 + +-- !sql -- +0 + +-- !sql -- +0 + +-- !sql -- +0 + +-- !sql -- +4 + +-- !sql -- +4 + +-- !sql -- +4 + +-- !sql -- +4 + +-- !sql -- +4 + +-- !sql -- +4 + +-- !sql -- +844 + +-- !sql -- +152 + +-- !sql -- +99 + +-- !sql -- +13 + +-- !sql -- +152 + +-- !sql -- +844 + +-- !sql -- +152 + +-- !sql -- +99 + +-- !sql -- +13 + +-- !sql -- +152 + +-- !sql -- +844 + +-- !sql -- +152 + +-- !sql -- +99 + +-- !sql -- +13 + +-- !sql -- +152 + +-- !sql -- +844 + +-- !sql -- +152 + +-- !sql -- +99 + +-- !sql -- +13 + +-- !sql -- +152 + diff --git a/regression-test/suites/fault_injection_p0/test_index_io_context.groovy b/regression-test/suites/fault_injection_p0/test_index_io_context.groovy index 23096432a3a08b..0601473cef0b73 100644 --- a/regression-test/suites/fault_injection_p0/test_index_io_context.groovy +++ b/regression-test/suites/fault_injection_p0/test_index_io_context.groovy @@ -86,24 +86,70 @@ suite("test_index_io_context", "nonConcurrent") { qt_sql """ select count() from ${tableName2} where request match_any 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_any 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_any 'ticket_quest_bg2.jpg'; """ + qt_sql """ select count() from ${tableName1} where request match_all 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName1} where request match_all 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName1} where request match_all 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_all 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_all 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_all 'ticket_quest_bg2.jpg'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg'; """ qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg ~10+'; """ qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg ~10+'; """ qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg ~10+'; """ qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg ~10+'; """ qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg ~10+'; """ qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg ~10+'; """ + + qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg ~10'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg ~10'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase 'ticket_quest_bg2.jpg ~10'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg ~10'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg ~10'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase 'ticket_quest_bg2.jpg ~10'; """ + + qt_sql """ select count() from ${tableName1} where request match_phrase_prefix 'ticket_quest_bg ~10'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase_prefix 'ticket_quest_bg ~10'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase_prefix 'ticket_quest_bg ~10'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase_prefix 'ticket_quest_bg ~10'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase_prefix 'ticket_quest_bg ~10'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase_prefix 'ticket_quest_bg ~10'; """ + + qt_sql """ select count() from ${tableName1} where request match_phrase_prefix 'quest'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase_prefix 'quest'; """ + qt_sql """ select count() from ${tableName1} where request match_phrase_prefix 'quest'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase_prefix 'quest'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase_prefix 'quest'; """ + qt_sql """ select count() from ${tableName2} where request match_phrase_prefix 'quest'; """ + + qt_sql """ select count() from ${tableName1} where status = '200'; """ + qt_sql """ select count() from ${tableName1} where status = '304'; """ + qt_sql """ select count() from ${tableName1} where size = '24736'; """ + qt_sql """ select count() from ${tableName1} where size = '985'; """ + qt_sql """ select count() from ${tableName1} where size = '0'; """ + qt_sql """ select count() from ${tableName2} where status = '200'; """ + qt_sql """ select count() from ${tableName2} where status = '304'; """ + qt_sql """ select count() from ${tableName2} where size = '24736'; """ + qt_sql """ select count() from ${tableName2} where size = '985'; """ + qt_sql """ select count() from ${tableName2} where size = '0'; """ + + qt_sql """ select count() from ${tableName1} where status = '200'; """ + qt_sql """ select count() from ${tableName1} where status = '304'; """ + qt_sql """ select count() from ${tableName1} where size = '24736'; """ + qt_sql """ select count() from ${tableName1} where size = '985'; """ + qt_sql """ select count() from ${tableName1} where size = '0'; """ + qt_sql """ select count() from ${tableName2} where status = '200'; """ + qt_sql """ select count() from ${tableName2} where status = '304'; """ + qt_sql """ select count() from ${tableName2} where size = '24736'; """ + qt_sql """ select count() from ${tableName2} where size = '985'; """ + qt_sql """ select count() from ${tableName2} where size = '0'; """ } finally { GetDebugPoint().disableDebugPointForAllBEs("InvertedIndexReader.handle_searcher_cache.io_ctx") }