Exemple #1
0
 public IndexMultiKey(
     bool unique,
     IList <IndexedPropDesc> hashIndexedProps,
     IList <IndexedPropDesc> rangeIndexedProps,
     AdvancedIndexDesc advancedIndexDesc)
 {
     IsUnique          = unique;
     HashIndexedProps  = hashIndexedProps.ToArray();
     RangeIndexedProps = rangeIndexedProps.ToArray();
     AdvancedIndexDesc = advancedIndexDesc;
 }
 public static IndexMultiKey FindExactMatchNameAndType(
     ICollection <IndexMultiKey> indexMultiKeys,
     bool unique,
     IList <IndexedPropDesc> hashProps,
     IList <IndexedPropDesc> btreeProps,
     AdvancedIndexDesc advancedIndexDesc)
 {
     foreach (IndexMultiKey existing in indexMultiKeys)
     {
         if (IsExactMatch(existing, unique, hashProps, btreeProps, advancedIndexDesc))
         {
             return(existing);
         }
     }
     return(null);
 }
 private static bool IsExactMatch(
     IndexMultiKey existing, bool unique,
     IList <IndexedPropDesc> hashProps,
     IList <IndexedPropDesc> btreeProps,
     AdvancedIndexDesc advancedIndexDesc)
 {
     if (existing.IsUnique != unique)
     {
         return(false);
     }
     if (!IndexedPropDesc.Compare(existing.HashIndexedProps, hashProps))
     {
         return(false);
     }
     if (!IndexedPropDesc.Compare(existing.RangeIndexedProps, btreeProps))
     {
         return(false);
     }
     if (existing.AdvancedIndexDesc == null)
     {
         return(advancedIndexDesc == null);
     }
     return(advancedIndexDesc != null && existing.AdvancedIndexDesc.EqualsAdvancedIndex(advancedIndexDesc));
 }
Exemple #4
0
 public bool EqualsAdvancedIndex(AdvancedIndexDesc that)
 {
     return(IndexTypeName.Equals(that._indexTypeName) && ExprNodeUtility.DeepEquals(_indexedExpressions, that._indexedExpressions, true));
 }