mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-28 10:41:12 +00:00
Compiling a pattern is expensive and so we should try to do it at prepare time, if the pattern is a constant. Add an optimizer that looks for such cases and replaces them with a unary function that embeds the compiled pattern. This isn't integrated yet with prepare_expr(), since the filtering code isn't ready for generic expressions. Its first user will be LWT, which contains the optimization already (filtering had it as well, but lost it sometime during the expression rewrite). A unit test is added.