Begin postp count query rewrite