Using an index to answer queries