* Rewrite query the new way. Should make bug 16636 easier.