mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-26 19:50:51 +00:00
Trying another fix
This commit is contained in:
parent
439bbd9861
commit
8097c696de
@ -90,9 +90,6 @@ double mapPiecewiseLinearToUnit(double value, double min, double max)
|
|||||||
|
|
||||||
/** Is allowed to merge parts in range with specific properties.
|
/** Is allowed to merge parts in range with specific properties.
|
||||||
*/
|
*/
|
||||||
#if defined(__clang__)
|
|
||||||
ALWAYS_INLINE
|
|
||||||
#endif
|
|
||||||
bool allow(
|
bool allow(
|
||||||
double sum_size,
|
double sum_size,
|
||||||
double max_size,
|
double max_size,
|
||||||
@ -104,7 +101,9 @@ bool allow(
|
|||||||
// std::cerr << "sum_size: " << sum_size << "\n";
|
// std::cerr << "sum_size: " << sum_size << "\n";
|
||||||
|
|
||||||
/// Map size to 0..1 using logarithmic scale
|
/// Map size to 0..1 using logarithmic scale
|
||||||
double size_normalized = mapPiecewiseLinearToUnit(log1p(sum_size), log1p(settings.min_size_to_lower_base), log1p(settings.max_size_to_lower_base));
|
/// Use log(1 + x) instead of log1p(x) because our x variables (sum_size and settings) are always integer.
|
||||||
|
/// Also log1p seems to be slow and significantly affect performance of merges assignment.
|
||||||
|
double size_normalized = mapPiecewiseLinearToUnit(log(1 + sum_size), log(1 + settings.min_size_to_lower_base), log(1 + settings.max_size_to_lower_base));
|
||||||
|
|
||||||
// std::cerr << "size_normalized: " << size_normalized << "\n";
|
// std::cerr << "size_normalized: " << size_normalized << "\n";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user