Exemple #1
0
        /// <summary>
        /// Creates a temporary index
        /// </summary>
        /// <param name="IndexColumns"></param>
        /// <returns></returns>
        public virtual TreeIndex CreateTemporyIndex(Key IndexColumns)
        {
            TreeIndex idx = TreeIndex.CreateExternalIndex(this, IndexColumns);

            this._Host.TableStore.PlaceInRecycleBin(idx.Storage.Key);
            return(idx);
        }
Exemple #2
0
 public void AddIndex(TreeIndex Idx)
 {
     if (this.Count >= IndexCollection.MAX_INDEX_COUNT)
     {
         throw new Exception("Cannot have more than eight indexes");
     }
     this._Indexes.Allocate(Idx.Header.Name, Idx);
 }
Exemple #3
0
 public IndexCollection(List <IndexHeader> Headers, Table Parent)
     : this()
 {
     foreach (IndexHeader h in Headers)
     {
         TreeIndex i = new TreeIndex(Parent, Parent, h);
         this.AddIndex(i);
     }
 }
Exemple #4
0
        /// <summary>
        /// Creates and builds a temporary index
        /// </summary>
        /// <param name="Parent"></param>
        /// <param name="IndexColumns"></param>
        /// <returns></returns>
        public static TreeIndex BuildTemporaryIndex(Table Parent, Key IndexColumns)
        {
            Schema     columns = BinaryRecordTree.NonClusteredIndexColumns(Parent.Columns, IndexColumns);
            ShellTable storage = new ShellTable(Parent.Host, Host.RandomName, Parent.Host.TempDB, columns, Page.DEFAULT_SIZE);
            TreeIndex  idx     = new TreeIndex(storage, Parent, Host.RandomName, IndexColumns);

            idx.Calibrate();
            Parent.Host.TableStore.PlaceInRecycleBin(storage.Key);
            return(idx);
        }
Exemple #5
0
        public void CreateIndex(Table Parent, string Name, Key Key)
        {
            if (this.Count >= IndexCollection.MAX_INDEX_COUNT)
            {
                throw new Exception("Cannot have more than eight indexes");
            }
            TreeIndex idx = new TreeIndex(Parent, Parent, Name, Key);

            this._Indexes.Allocate(Name, idx);
            Parent.Header.IndexHeaders.Add(idx.Header);
        }
Exemple #6
0
        // Methods //
        /// <summary>
        /// Inserts a record into the index
        /// </summary>
        /// <param name="Key">The record</param>
        /// <param name="Key">The position it's located in the table</param>
        public virtual void Insert(Record Element, RecordKey Key)
        {
            Record x = TreeIndex.GetIndexElement(Element, Key, this._IndexColumns);

            this._Tree.Insert(x);
        }