From 0ef43f9d08d736c558b43290bfedd30d4a9e9b7e Mon Sep 17 00:00:00 2001 From: Laurens Kuiper Date: Mon, 26 Aug 2024 13:20:07 +0200 Subject: [PATCH] fully reinitialize stats --- src/storage/table/row_group_collection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/storage/table/row_group_collection.cpp b/src/storage/table/row_group_collection.cpp index b78f2b733253..62140832571c 100644 --- a/src/storage/table/row_group_collection.cpp +++ b/src/storage/table/row_group_collection.cpp @@ -334,6 +334,8 @@ void RowGroupCollection::InitializeAppend(TransactionData transaction, TableAppe state.start_row_group->InitializeAppend(state.row_group_append_state); state.transaction = transaction; + // initialize thread-local stats so we have less lock contention when updating distinct statistics + state.stats = TableStatistics(); state.stats.InitializeEmpty(types); }