
Clickhouse got stuck and had thrown a coredump
Optimize table process has been started there before the fail


**Does it reproduce on recent release?**

v22.3.6.5-lts

**Error message and/or stacktrace**

https://pastila.nl/?00ea0713/9ad972e00fde60564ff00853050fcc1d

Can't provide the coredump file for NDA reason, but ready to analyse it


#pragma once
#include <AggregateFunctions/AggregateFunctionFactory.h>
#include <DataTypes/DataTypeFactory.h>
#include <Functions/FunctionFactory.h>
#include <IO/WriteHelpers.h>
#include <Interpreters/InDepthNodeVisitor.h>
#include <Interpreters/IdentifierSemantic.h>
#include <Parsers/ASTFunction.h>
#include <Parsers/ASTIdentifier.h>
#include <Parsers/ASTOrderByElement.h>
#include <Parsers/ASTTablesInSelectQuery.h>
#include <Parsers/IAST.h>
#include <Common/typeid_cast.h>
namespace DB
{
using Monotonicity = IFunctionBase::Monotonicity;
class MonotonicityCheckMatcher