bottom-up beats top-down for datalog
We show that for any safe datalog program P 1 and any query Q (predicate of P 1 with some bound arguments), there is another safe datalog program P 2 that produces the answer to Q and takes no more time when evaluated by semi-naive evaluation than when P 1 is evaluated topdown.
datalog query argument timing evaluation