https://opensource.googleblog.com/2021/04/logica-organizing-...
(Datalog/Prolog family language compiled to SQL)
And yes, this kind of thing is why datalog is a lot more amenable to fast query plans & runtimes than prolog. This part is especially cool: https://github.com/EvgSkv/logica/blob/main/compiler/dialects...
https://opensource.googleblog.com/2021/04/logica-organizing-...
(Datalog/Prolog family language compiled to SQL)