match now makes only one query for items