We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2301d9f commit f8caef6Copy full SHA for f8caef6
src/optimizer/join_order/relation_statistics_helper.cpp
@@ -350,7 +350,8 @@ RelationStats RelationStatisticsHelper::ExtractAggregationStats(LogicalAggregate
350
// most likely we are running on parquet files. Therefore we divide by 2.
351
new_card = (double)child_stats.cardinality / 2;
352
}
353
- stats.cardinality = LossyNumericCast<idx_t>(new_card);
+ // an ungrouped aggregate has 1 row
354
+ stats.cardinality = aggr.groups.empty() ? 1 : LossyNumericCast<idx_t>(new_card);
355
stats.column_names = child_stats.column_names;
356
stats.stats_initialized = true;
357
auto num_child_columns = aggr.GetColumnBindings().size();
0 commit comments