示例#1
0
        public void CreateView(string viewName, string viewDefinition, Transaction transaction)
        {
            var tableInfo  = _tableManager.GetTableInfo(_viewTableName, transaction);
            var recordFile = new RecordFile(tableInfo, transaction);

            recordFile.Insert();
            recordFile.SetString("viewname", viewName);
            recordFile.SetString("viewdef", viewDefinition);
            recordFile.Close();
        }
示例#2
0
        public IndexManager(
            bool isNew,
            ITableManager tableManager,
            IStatisticsManager statisticsManager,
            Transaction transaction,
            string indexTableName = "idxcat",
            int blockSize         = 1024)
        {
            _indexTableName = indexTableName;

            _blockSize         = blockSize;
            _tableManager      = tableManager;
            _statisticsManager = statisticsManager;

            if (isNew)
            {
                var schema = new Schema();

                schema.AddStringField("idxname", MAX_INDEX_LENGTH);
                schema.AddStringField("tblname", MAX_INDEX_LENGTH);
                schema.AddStringField("fldname", MAX_INDEX_LENGTH);

                tableManager.CreateTable(_indexTableName, schema, transaction);
            }

            _tableInfo = tableManager.GetTableInfo(indexTableName, transaction);
        }
示例#3
0
        private void RefreshStatistics(Transaction transaction)
        {
            _tableStats.Clear();

            _callsNumber = 0;

            var tableCatalogInfo = _tableManager.GetTableInfo(_tableCatalogName, transaction);

            var recordFile = new RecordFile(tableCatalogInfo, transaction);

            while (recordFile.Next())
            {
                var tableName = recordFile.GetString("tblname");
                _ = RefreshTableStatistics(tableName, transaction);
            }
        }
示例#4
0
        public IndexInfo(string indexName,
                         string tableName,
                         string fieldName,
                         ITableManager tableManager,
                         IStatisticsManager statisticsManager,
                         Transaction transaction,
                         int blockSize = 1024)
        {
            _indexName   = indexName;
            _fieldName   = fieldName;
            _transaction = transaction;

            _blockSize = blockSize;
            _tableInfo = tableManager.GetTableInfo(tableName, transaction);
            _statInfo  = statisticsManager.GetStatisticalInfo(tableName, transaction);
        }
示例#5
0
 public TableInfo GetTableInfo(string tableName, Transaction transaction)
 {
     return(_tableManager.GetTableInfo(tableName, transaction));
 }