Efficient Query from File