Currently, we only log the rule_id when we log a query and its rewriting paths. And we allow deleting rules. Thus, for deleted rules, the logged queries' rewriting paths can have obsolete rule_ids that do not exist anymore.
We still want to support deleting rules. And we also want to keep the query logs with rewriting paths.
Therefore, we can modify the way we log queries' rewriting paths and keep a snapshot of the rule at the moment.