Skip to content

Commit 4cd3183

Browse files
committed
Use views instead of tables as guards to avoid ClickHouse scheduling merges on dummy tables.
1 parent f12cc8e commit 4cd3183

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Source/moja.modules.cbm/src/cbmaggregatorhybridlibpqxxwriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace cbm {
8383
// ClickHouse doesn't support unique constraints, so the guard against
8484
// duplicate loads for the same job has to be a table. If this is a
8585
// duplicate, the transaction will fail and roll back the data load.
86-
chTx.exec((boost::format("CREATE TABLE %1%.%2% (x INTEGER) ENGINE = MergeTree() ORDER BY x;") % _schema % guardTable).str());
86+
chTx.exec((boost::format("CREATE VIEW %1%.%2% AS SELECT 1;") % _schema % guardTable).str());
8787

8888
load(chTx, (boost::format("%1%.raw_fluxes") % _schema).str(), _fluxDimension);
8989
load(chTx, (boost::format("%1%.raw_pools") % _schema).str(), _poolDimension);

0 commit comments

Comments
 (0)