v.25.12Performance Improvement

Optimize the histogram aggregate function by sorting

Optimize the histogram aggregate function by sorting only the tail of points array and skipping sort for monotonic inputs, achieving ~10% speedup. #85760 (MakarDev).