optimize_and_compare_chain
Populate constant comparison in AND chains to enhance filtering ability. Support operators<, <=, >, >=, = and mix of them. For example, (a < b) AND (b < c) AND (c < 5) would be (a < b) AND (b < c) AND (c < 5) AND indexHint(b < 5) AND indexHint(a < 5). The derived comparisons are wrapped in indexHint: they participate in index analysis (primary key, partition key, skipping indexes) and prune the read set, but cost nothing per row and do not affect PREWHERE. A comparison derived through expressions of different tables stays executable ((t1.a < t2.b) AND (t2.b < 5) derives plain t1.a < 5): it is the only condition that can be pushed below the join, where it filters a join input the original chain cannot reach. Derived comparisons that contradict an existing condition are also added as plain conditions, so the AND folds to false.
optimize_and_compare_chain_max_hash_work
Work budget for theoptimize_and_compare_chain optimization during query analysis, measured in the number of query-tree nodes hashed by getTreeHash (the dominant cost of this optimization). Once a query has hashed more than this many nodes while applying the optimization, it stops applying it for the rest of the query. This bounds analysis time for queries with very many or very large AND-chains of comparisons, where the optimization can otherwise dominate analysis while folding nothing. Stopping early is always safe: it only forgoes an optimization and never changes results. Set to 0 to disable the budget (unlimited).