Esempio n. 1
0
            public RangeChecker(BlindSearchIndex scheme, IndexRange[] ranges)
            {
                this.scheme = scheme;

                int size = ranges.Length;

                lowerFlags = new byte[size];
                upperFlags = new byte[size];
                lowerCells = new DataObject[size];
                upperCells = new DataObject[size];
                for (int i = 0; i < ranges.Length; ++i)
                {
                    SetupRange(i, ranges[i]);
                }
            }
Esempio n. 2
0
        protected override ColumnIndex GetIndex(int column, int originalColumn, ITable table)
        {
            var index = columnIndexes[column];
            if (index == null) {
                index = new BlindSearchIndex(this, column);
                columnIndexes[column] = index;
            }

            // If we are getting a scheme for this table, simple return the information
            // from the column_trees Vector.
            if (table == this)
                return index;

            // Otherwise, get the scheme to calculate a subset of the given scheme.
            return index.GetSubset(table, originalColumn);
        }
Esempio n. 3
0
            public RangeChecker(BlindSearchIndex scheme, IndexRange[] ranges)
            {
                this.scheme = scheme;

                int size = ranges.Length;
                lowerFlags = new byte[size];
                upperFlags = new byte[size];
                lowerCells = new DataObject[size];
                upperCells = new DataObject[size];
                for (int i = 0; i < ranges.Length; ++i) {
                    SetupRange(i, ranges[i]);
                }
            }
Esempio n. 4
0
        protected virtual void SetupIndexes(Type indexType)
        {
            indexes = new ColumnIndex[ColumnCount];
            for (int i = 0; i < ColumnCount; i++) {
                if (indexType == typeof (BlindSearchIndex)) {
                    indexes[i] = new BlindSearchIndex(this, i);
                } else if (indexType == typeof (InsertSearchIndex)) {
                    indexes[i] = new InsertSearchIndex(this, i);
                } else {
                    var index = Activator.CreateInstance(indexType, this, i) as ColumnIndex;
                    if (index == null)
                        throw new InvalidOperationException();

                    indexes[i] = index;
                }
            }
        }
Esempio n. 5
0
        protected override ColumnIndex GetIndex(int column, int originalColumn, ITable table)
        {
            if (ColumnIndices[column] == null) {
                // EFFICIENCY: We implement this with a blind search...
                var index = new BlindSearchIndex(this, column);
                ColumnIndices[column] = index.GetSubset(this, column);
            }

            if (table == this)
                return ColumnIndices[column];

            return ColumnIndices[column].GetSubset(table, originalColumn);
        }