Explain to be called on rewritten query
Add more logging to rewriting