Added arbitrary query subsetting.