mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 10:02:01 +00:00
add option to force deduplicate children
This commit is contained in:
parent
2734347cc0
commit
1d391e2841
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user