v.24.1Improvement

Make format function return constant on constant arguments

Make function format return constant on constant arguments. This closes #58355. #58358 (Alexey Milovidov).
The format function is optimized to return a constant result when called with constant arguments.

Why it matters

This feature addresses performance by ensuring that format, when provided with constant arguments, evaluates to a constant value at query compile time rather than at runtime. This reduces overhead and improves query efficiency.

How to use it

Simply use the format function with constant arguments in your queries. The function will automatically return a constant result without any additional configuration.