stuff for querying the compound index