提交 1d391e28 编写于 作者: Y Yury Stankevich

add option to force deduplicate children

上级 2734347c
......@@ -395,6 +395,7 @@ struct Settings : public SettingsCollection<Settings>
M(SettingBool, enable_early_constant_folding, true, "Enable query optimization where we analyze function and subqueries results and rewrite query if there're constants there", 0) \
\
M(SettingBool, partial_revokes, false, "Makes it possible to revoke privileges partially.", 0) \
M(SettingBool, force_deduplicate_childrens, false, "If the 'root' table deduplicates blocks, there are no need to make deduplication for children. Use true to always deduplicate childrens.", 0) \
\
/** Obsolete settings that do nothing but left for compatibility reasons. Remove each one after half a year of obsolescence. */ \
\
......
......@@ -29,7 +29,9 @@ PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream(
/// If the "root" table deduplactes blocks, there are no need to make deduplication for children
/// Moreover, deduplication for AggregatingMergeTree children could produce false positives due to low size of inserting blocks
bool disable_deduplication_for_children = !no_destination && storage->supportsDeduplication();
bool disable_deduplication_for_children = false;
if (!context.getSettingsRef().force_deduplicate_childrens)
disable_deduplication_for_children = !no_destination && storage->supportsDeduplication();
auto table_id = storage->getStorageID();
Dependencies dependencies = context.getDependencies(table_id);
......@@ -130,7 +132,7 @@ void PushingToViewsBlockOutputStream::write(const Block & block)
}
/// Don't process materialized views if this block is duplicate
if (replicated_output && replicated_output->lastBlockIsDuplicate())
if (!context.getSettingsRef().force_deduplicate_childrens && replicated_output && replicated_output->lastBlockIsDuplicate())
return;
// Insert data into materialized views only after successful insert into main table
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册