Skip to content

Commit

Permalink
remove unnecessary optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
lnkuiper committed Aug 23, 2024
1 parent 6407d24 commit d7d31b8
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/storage/statistics/column_statistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,9 @@ void ColumnStatistics::SetDistinct(unique_ptr<DistinctStatistics> distinct) {
}

void ColumnStatistics::UpdateDistinctStatistics(Vector &v, idx_t count) {
static constexpr idx_t MAXIMUM_STRING_LENGTH_FOR_DISTINCT = 64;
if (!distinct_stats) {
return;
}
if (stats.GetType().InternalType() == PhysicalType::VARCHAR && StringStats::HasMaxStringLength(stats) &&
StringStats::MaxStringLength(stats) > MAXIMUM_STRING_LENGTH_FOR_DISTINCT) {
// We start bailing out on distinct statistics if we encounter long strings,
// because hashing them for HLL is expensive and they probably won't be used as join keys anyway.
// If they are used as join keys, we will still have decent join orders (same method as Parquet)
distinct_stats.reset();
return;
}
distinct_stats->Update(v, count);
}

Expand Down

0 comments on commit d7d31b8

Please sign in to comment.