Esempio n. 1
0
        /// <summary>
        /// Creates an external index, but does not load it
        /// </summary>
        /// <param name="Parent"></param>
        /// <param name="IndexColumns"></param>
        /// <returns></returns>
        public static TreeIndex CreateExternalIndex(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);

            return(new TreeIndex(storage, Parent, Host.RandomName, IndexColumns));
        }
Esempio n. 2
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);
        }