adjusted the perftest

This commit is contained in:
myrrc 2020-11-03 18:01:29 +03:00
parent ab1b7267b6
commit 5c6bd218ad
2 changed files with 4 additions and 4 deletions

View File

@ -24,9 +24,9 @@ public:
using WeightRet = std::conditional_t<DecimalOrExtendedInt<Weight>, Float64, Weight>;
const WeightRet weight = [&columns, row_num]() -> WeightRet {
if constexpr(IsDecimalNumber<Weight>)
if constexpr(IsDecimalNumber<Weight>) /// Unable to cast to double -> use the virtual method
return columns[1]->getFloat64(row_num);
else if constexpr(DecimalOrExtendedInt<Weight>)
else if constexpr(DecimalOrExtendedInt<Weight>) /// Casting to double, otherwise += would be ambitious.
return static_cast<Float64>(static_cast<const ColumnVector<Weight>&>(*columns[1]).getData()[row_num]);
else
return static_cast<const ColumnVector<Weight>&>(*columns[1]).getData()[row_num];

View File

@ -13,8 +13,8 @@
INSERT INTO perf_avg(num)
SELECT number / r
FROM system.numbers
ARRAY JOIN range(1, 1000000) AS r
LIMIT 500000000
ARRAY JOIN range(1, 10000) AS r
LIMIT 5000000
</fill_query>
<query>SELECT avg(num) FROM perf_avg</query>