fix a bug in rewrite/filter phase.
index memory footprint