public void findIndexUsageForPair(TablePairActivity tablePair) {
		for (Query query : queries) {
			List<String> queryRelations = query.getRelations();
			Set<QueryFilter> queryFilters = query.getSelections();

			String tableA = tablePair.getNameOfTableA();
			String tableB = tablePair.getNameOfTableB();

			if (tablePair.isPair() && queryRelations.contains(tableA)
					&& queryRelations.contains(tableB)) {
				// check queries that contain both of the tables
				for (QueryFilter qf : queryFilters) {
					QueryAttribute qa = qf.getLeftAttribute();

					// if the query uses a unique index, then that table is
					// credited with the number of times the query appears
					if (db.isUniqueKey(qa.getTableName(), qa.getColumnName())) {
						if (qa.getTableName().equals(tableA)) {
							tablePair.addUsageIndexA(query.getTimesUsed());
						} else if (qa.getTableName().equals(tableB)) {
							tablePair.addUsageIndexB(query.getTimesUsed());
						}
					}
				}
			}
		}
	}