Rewrite analysis for MySQL