flush cached query to local file