transparently handle gzipped query files