Democratize MATCH_RECOGNIZE!
Louisa Lambrecht • Tim Findling • Samuel Heid • Marcel Knüdeler • Torsten Grust
Proceedings of 51st Int’l Conference on Very Large Databases (VLDB 2025), September 1-5, 2025, London, UK. PVLDB, Volume 18. (To be published.)
BibTeX Citation
To be published
Row pattern matching in terms of the MATCH_RECOGNIZE clause is a powerful and relatively recent feature in SQL that allows users to define regular patterns over ordered rows in a table. As of today, few database systems offer support for match recognize, making it unaccessible to a wide range of users. We demonstrate the im- plementation of a transpiler that translates match recognize into a plain SQL query executable by any database system that supports window functions and recursive common table expressions—no changes to the underlying database systems are required.
We evaluate the performance of this approach on the running example to show that the transpiler generates code competitive with contemporary database systems that implement row pattern matching natively. The on-site demonstration is based on DuckDB.