Adapted db query for empty shoe filter