From a7a18e3876a041c6a7e25f8adcffd45f1afcbfc2 Mon Sep 17 00:00:00 2001 From: Nicolas Vandeginste Date: Tue, 19 May 2026 11:38:02 +0200 Subject: [PATCH 1/2] Delay Iceberg manifest initialization until after pruning --- src/planning/iceberg_multi_file_list.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/planning/iceberg_multi_file_list.cpp b/src/planning/iceberg_multi_file_list.cpp index 52a3da206..a040898c8 100644 --- a/src/planning/iceberg_multi_file_list.cpp +++ b/src/planning/iceberg_multi_file_list.cpp @@ -347,10 +347,6 @@ void IcebergMultiFileList::Bind(vector &return_types, vector(iceberg_path, std::move(temp_data), snapshot_info, *schema); } - if (!view_initialized) { - InitializeFiles(guard); - } - auto &schema = GetSchema().columns; for (auto &schema_entry : schema) { names.push_back(Identifier(schema_entry->name)); @@ -457,10 +453,6 @@ vector IcebergMultiFileList::GetAllFiles() const { } FileExpandResult IcebergMultiFileList::GetExpandResult() const { - // GetFileInternal(1) will ensure files with index 0 and index 1 are expanded if they are available - lock_guard guard(shared_state->lock); - GetFileInternal(1, guard); - // always return multiple files, In the case there is only 1 data file, // we only lose performance if it is small return FileExpandResult::MULTIPLE_FILES; @@ -484,9 +476,10 @@ unique_ptr IcebergMultiFileList::GetCardinality(ClientContext &c return nullptr; } - //! Make sure we have fetched all manifests - (void)GetTotalFileCount(); - D_ASSERT(view_initialized); + if (!view_initialized) { + //! Avoid forcing manifest initialization before filter pushdown has had a chance to narrow the table. + return nullptr; + } idx_t cardinality = 0; for (idx_t i = 0; i < data_manifests.size(); i++) { @@ -536,6 +529,11 @@ void IcebergMultiFileList::GetStatistics(vector &result) co return; } + if (!view_initialized) { + //! Avoid forcing manifest initialization before filter pushdown has had a chance to narrow the table. + return; + } + for (idx_t i = 0; i < delete_manifests.size(); i++) { if (delete_manifest_matches[i]) { //! if a matching delete manifest exists, return; From 883c4ef7c80194b2b3f554b91b8ed2f440c7133d Mon Sep 17 00:00:00 2001 From: Nicolas Vandeginste Date: Wed, 27 May 2026 16:22:36 +0200 Subject: [PATCH 2/2] Update Iceberg request logging test --- .../enable_logging_http/test_table_information_requests.test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test b/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test index 05be638e3..ece12432d 100644 --- a/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test +++ b/test/sql/local/catalog_custom_setup/fixture/enable_logging_http/test_table_information_requests.test @@ -78,8 +78,6 @@ with cte as ( ) select CASE WHEN contains(val, '.') THEN (split(val, '.')[2]) ELSE NULL END FROM CTE ORDER BY ALL ---- -avro -avro NULL statement ok @@ -126,6 +124,8 @@ with cte as ( ) select CASE WHEN contains(val, '.') THEN (split(val, '.')[2]) ELSE NULL END FROM CTE ORDER BY ALL ---- +avro +avro parquet NULL