flatten-query