clickhouse improve sync speed

This commit is contained in:
Bilal Godil 2026-03-18 14:07:26 -07:00
parent bf008e21b2
commit 2bd11cb7ad

View File

@ -1433,7 +1433,9 @@ async function syncClickhouseMapping(
}
const clickhouseTableName = `analytics_internal.${mapping.targetTable}`;
await ensureClickhouseSchema(client, tableSchema, clickhouseTableName);
// Skip ensureClickhouseSchema — we only sync to our own internal ClickHouse
// where tables are already created. CREATE TABLE IF NOT EXISTS is always a
// no-op but costs a slow DDL round trip per mapping per sync invocation.
let lastSequenceId = await getClickhouseLastSyncedSequenceId(client, tenancyId, mappingId);