support two sample queries