ah, yeah, i could see that would make it a bit more complicated.
Another idea I had was essentially passing a map where we had
{:city1-zip1-road1 "magic-value-1",
:city2-zip2-road2 "magic-value-2",
... ;; a few thousand of these
:fact-type :path}
(defn join-with-dash
[& args]
(apply str/join "-" args))
(defrule moo
[:account (= account "some-value") (= ?city city)]
[:route (= ?road road) (= ?zip zip) (= ?joined (join-str-with-dash ?city ?zip ?path))]
[:path (= ?found-path ?joined)]
...
=>
(println "do something"))I'm not sure what you think of that idea
I suspect it might be more performant
Obviously I'm limited to what I can turn into a keyword
possibly faster, however that would be really tightly coupled to the data itself. In general, the comparisons to make the joins should be fast assuming they simple joins (field equality). I would probably start with a rule similar to the original rule, and do real world testing... if that proves too inefficient then come to the rule and tune it.
I appreciate your input @ethanc. Thank you so much
I'll try the original and see how it goes
no problem, if you do see issues, with performance you can log an issue and we can try and identify the source of the pain
Much appreciated!