You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DROPTABLE IF EXISTS dict_source;
DROP DICTIONARY IF EXISTS test_cache_dict;
CREATETABLEdict_source engine = Log ASSELECTnumberas id, toString(number) as value FROM numbers(10000);
CREATE DICTIONARY IF NOT EXISTS test_cache_dict (
id UInt64,
value String
)
PRIMARY KEY id
SOURCE(
CLICKHOUSE(
host '127.0.0.2'
DB currentDatabase()
TABLE 'dict_source'
)
)
LAYOUT(
CACHE(SIZE_IN_CELLS 10000)
)
LIFETIME(MIN 1 MAX 100);
SELECT dictGet(test_cache_dict, 'value', materialize(toUInt64(1000))) FROM numbers_mt(1000) SETTINGS max_block_size =50, max_threads =4 FORMAT Null;
system flush logs;
SELECT event_time, query FROMsystem.query_logWHERE event_time > now() -300and has(tables, currentDatabase() ||'.dict_source') and type ='QueryFinish'and type ='QueryFinish'and query_kind='Select'ORDER BY event_time DESCLIMIT10;
SELECT dict_key, count(query_id) number_of_queries_to_source, sum(count_per_query) as sum_key_requests, max(count_per_query) as max_key_requests_per_query FROM (
SELECT arrayJoin(splitByRegexp(',\s+', extract(query, 'IN \((.*)\);'))) as dict_key, query_id, count() count_per_query FROMsystem.query_logWHERE event_time > now() -300and has(tables, currentDatabase() ||'.dict_source') and type ='QueryFinish'and query_kind='Select'GROUP BY dict_key, query_id) GROUP BY dict_key FORMAT PrettyCompactMonoBlock;
The text was updated successfully, but these errors were encountered:
Is the fix gong to be applied to the query that is issued against the source of the dictionary? Or would it apply to the queue, eg. by making tryPushToUpdateQueueOrThrow a noop if the key is already in the the queue to be updated?
We've had issues with dictionary update queue sizes due to a very large number of dictGet operations, which often add the same key to the update queue over and over until the first update task populates the value.
then one single block of data processed by dictGet have a lot of duplicate keys ClickHouse will construct suboptimal query like
instead of simple
Repro:
The text was updated successfully, but these errors were encountered: