mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Merge pull request #60348 from zhongyuankai/query_cache_minor_change
QueryCache: Don't acquire the query count mutex if not necessary
This commit is contained in:
commit
4171ede556
@ -1167,7 +1167,7 @@ static std::tuple<ASTPtr, BlockIO> executeQueryImpl(
|
|||||||
std::chrono::system_clock::now() + std::chrono::seconds(settings.query_cache_ttl),
|
std::chrono::system_clock::now() + std::chrono::seconds(settings.query_cache_ttl),
|
||||||
settings.query_cache_compress_entries);
|
settings.query_cache_compress_entries);
|
||||||
|
|
||||||
const size_t num_query_runs = query_cache->recordQueryRun(key);
|
const size_t num_query_runs = settings.query_cache_min_query_runs ? query_cache->recordQueryRun(key) : 1; /// try to avoid locking a mutex in recordQueryRun()
|
||||||
if (num_query_runs <= settings.query_cache_min_query_runs)
|
if (num_query_runs <= settings.query_cache_min_query_runs)
|
||||||
{
|
{
|
||||||
LOG_TRACE(getLogger("QueryCache"),
|
LOG_TRACE(getLogger("QueryCache"),
|
||||||
|
Loading…
Reference in New Issue
Block a user