Checks if the property is a join and its internal properties are fully
indexed.
760209
private boolean isProperJoin(StorableProperty<?> property)
        throws SupportException, RepositoryException
    {
        if (!property.isJoin() || property.isQuery()) {
            return false;
        }

        // Make up a filter over the join's internal properties and then search
        // for an index that filters with no remainder.
        Filter<?> filter = Filter.getOpenFilter(property.getEnclosingType());
        int count = property.getJoinElementCount();
        for (int i=0; i<count; i++) {
            filter = filter.and(property.getInternalJoinElement(i).getName(), RelOp.EQ);
        }

        // Java generics are letting me down. I cannot use proper specification
        // because compiler gets confused with all the wildcards.
        Collection indexes = indexesFor(filter.getStorableType());

        if (indexes != null) {
            for (Object index : indexes) {
                FilteringScore score = FilteringScore.evaluate((StorableIndex) index, filter);
                if (score.getRemainderCount() == 0) {
                    return true;
                }
            }
        }

        return false;
    }
410829
def is_fullfilled_by(self, other):
        
        # allow the other index to be equally large only. It being larger is an option
        # but it creates a problem with scenarios of the kind PRIMARY KEY(foo,bar) UNIQUE(foo)
        if len(other.get_columns()) != len(self.get_columns()):
            return False

        # Check if columns are the same, and even in the same order
        if not self.spans_columns(other.get_columns()):
            return False

        if not self.same_partial_index(other):
            return False

        if self.is_simple_index():
            # this is a special case: If the current key is neither primary or unique,
            # any unique or primary key will always have the same effect
            # for the index and there cannot be any constraint overlaps.
            # This means a primary or unique index can always fulfill
            # the requirements of just an index that has no constraints.
            return True

        if other.is_primary() != self.is_primary():
            return False

        if other.is_unique() != self.is_unique():
            return False

        return True
510825
private boolean valueCached(int index) {
        boolean result = false;

        if (generatedCacheMap.containsKey(index) == true || resultSetCacheMap.containsKey(index) == true) {
            result = true;
        }

        return result;
    }
105565
protected boolean hasAllCanonicalTypes() {
        if (types.length==0) return false;
        for (String typeName : types) {
            InternalRelationType type = QueryUtil.getType(tx, typeName);
            if (type!=null && !type.isPropertyKey() && !type.multiplicity().isUnique(dir)) return false;
        }
        return true;
    }
72278
@Override
    protected void validateIndexStatus() {
        TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index);
        Set<SchemaStatus> acceptableStatuses = SchemaAction.REINDEX.getApplicableStatus();
        boolean isValidIndex = true;
        String invalidIndexHint;
        if (index instanceof RelationTypeIndex ||
                (index instanceof TitanGraphIndex && ((TitanGraphIndex)index).isCompositeIndex()) ) {
            SchemaStatus actualStatus = schemaVertex.getStatus();
            isValidIndex = acceptableStatuses.contains(actualStatus);
            invalidIndexHint = String.format(
                    "The index has status %s, but one of %s is required",
                    actualStatus, acceptableStatuses);
        } else {
            Preconditions.checkArgument(index instanceof TitanGraphIndex,"Unexpected index: %s",index);
            TitanGraphIndex gindex = (TitanGraphIndex)index;
            Preconditions.checkArgument(gindex.isMixedIndex());
            Map<String, SchemaStatus> invalidKeyStatuses = new HashMap<>();
            int acceptableFields = 0;
            for (PropertyKey key : gindex.getFieldKeys()) {
                SchemaStatus status = gindex.getIndexStatus(key);
                if (status!=SchemaStatus.DISABLED && !acceptableStatuses.contains(status)) {
                    isValidIndex=false;
                    invalidKeyStatuses.put(key.name(), status);
                    log.warn("Index {} has key {} in an invalid status {}",index,key,status);
                }
                if (acceptableStatuses.contains(status)) acceptableFields++;
            }
            invalidIndexHint = String.format(
                    "The following index keys have invalid status: %s (status must be one of %s)",
                    Joiner.on(",").withKeyValueSeparator(" has status ").join(invalidKeyStatuses), acceptableStatuses);
            if (isValidIndex && acceptableFields==0) {
                isValidIndex = false;
                invalidIndexHint = "The index does not contain any valid keys";
            }
        }
        Preconditions.checkArgument(isValidIndex, "The index %s is in an invalid state and cannot be indexed. %s", indexName, invalidIndexHint);
        // TODO consider retrieving the current Job object and calling killJob() if !isValidIndex -- would be more efficient than throwing an exception on the first pair processed by each mapper
        log.debug("Index {} is valid for re-indexing");
    }
266153
function hasIndexChanged(index, prevIndex) {
  if (typeof index !== 'string' || !index) return false;
  if (typeof prevIndex !== 'string' || !prevIndex) return true;
  return index !== prevIndex;
}
1352239
public boolean tableContainsIndex (Connection conn, String table, String index)
        throws SQLException
    {
        ResultSet rs = conn.getMetaData().getIndexInfo(null, null, table, false, true);
        while (rs.next()) {
            String tname = rs.getString("TABLE_NAME");
            String iname = rs.getString("INDEX_NAME");
            if (tname.equals(table) && index.equals(iname)) {
                return true;
            }
        }
        return false;
    }
904097
public function equals($join)
    {
        return parent::equals($join)
            && $this->relationMap == $join->getRelationMap()
            && $this->previousJoin == $join->getPreviousJoin()
            && $this->rightTableAlias == $join->getRightTableAlias();
    }
419972
public boolean compatible( PropertySet properties)
    {
    boolean isCompatible;
    Iterator<IDisjunct> disjuncts;
    
    for( disjuncts = getDisjuncts(),
           isCompatible = true;
           

         isCompatible
           && disjuncts.hasNext();

         isCompatible = disjuncts.next().compatible( properties));
    
    return isCompatible;
    }
1158722
private boolean validateJoinRequest(JoinRequest joinRequest, Address target) {
        if (clusterService.isMaster()) {
            try {
                node.getNodeExtension().validateJoinRequest(joinRequest);
            } catch (Exception e) {
                logger.warning(e.getMessage());
                nodeEngine.getOperationService().send(new BeforeJoinCheckFailureOp(e.getMessage()), target);
                return false;
            }
        }
        return true;
    }
820743
private void assertPropertyIsIndexed(final PropertyKey key) {

		if (key != null && !key.isIndexed() && key instanceof AbstractPrimitiveProperty) {

			final Class declaringClass = key.getDeclaringClass();
			String className           = "";

			if (declaringClass != null) {

				className = declaringClass.getSimpleName() + ".";
			}

			logger.warn("Non-indexed property key {}{} is used in query. This can lead to performance problems in large databases.", className, key.jsonName());
		}
	}
911329
def has_joins(queryset):
    
    for join in six.itervalues(queryset.query.alias_map):
        if join.join_type:
            return True
    return False
873448
@Override
	public boolean isStored() {

		if (isIdProperty()) {
			return true;
		}

		Indexed indexedAnnotation = getIndexAnnotation();
		return indexedAnnotation != null && indexedAnnotation.stored();
	}
405749
def _check_index_in_compilations(context: BaseContext, index: str):
    """"""
    compilations = 'compilations'
    if compilations not in context.shared_data:
        return False
    return index in context.shared_data[compilations]
1156133
def has_property(self, property_name):
        
        if property_name in self.properties:
            return True
        elif property_name in self.entities:
            return True
        elif property_name in self.collections:
            return True
        else:
            return False
355729
def is_indexed(self, identifier):
        
        query = text("""
            SELECT identifier
            FROM identifier_index
            WHERE identifier = :identifier;
        """)
        result = self.execute(query, identifier=identifier['identifier'])
        return bool(result.fetchall())
668052
private Optional<IndexBooleanExpression> getSupplementaryCondition(Set<String> allColumnsInColumnRelations, Map<String, Set<Object>> condition) {
        Map<String, Set<Object>> fixedValuesMap = condition.keySet().stream()
                .filter(cn -> !allColumnsInColumnRelations.contains(cn))
                .collect(Collectors.toMap(Function.identity(), condition::get));
        return fixedValuesMap.isEmpty() ?
                Optional.empty() :
                Optional.of(new IndexBooleanExpression(fixedValuesMap));
    }