コード例 #1
0
ファイル: MetadataManagerTests.cs プロジェクト: SaberMK/BiBi
        public void CanCreateIndexOnFilledTable()
        {
            var recordFile = new RecordFile(tableInfo, _transaction);

            recordFile.BeforeFirst();
            for (int i = 0; i < 10; ++i)
            {
                recordFile.Insert();
                recordFile.SetInt("Id", i - 1);
            }
            recordFile.Close();

            metadataManager = new MetadataManager(_fileManager, tableManager, viewManager, indexManager, statisticsManager);

            Assert.DoesNotThrow(() =>
            {
                metadataManager.CreateIndex(RandomFilename, tableName, "Id", _transaction);
            });

            var index = metadataManager.GetIndexInfo(tableName, _transaction);

            Assert.IsNotNull(index);
            Assert.AreEqual(0, index["Id"].BlocksAccessed());
            Assert.AreEqual(2, index["Id"].RecordsOutput());
        }
コード例 #2
0
ファイル: MetadataManagerTests.cs プロジェクト: SaberMK/BiBi
        public void CanCreateIndexAndGetInfo()
        {
            metadataManager = new MetadataManager(_fileManager, tableManager, viewManager, indexManager, statisticsManager);

            Assert.DoesNotThrow(() =>
            {
                metadataManager.CreateIndex(RandomFilename, tableName, "Id", _transaction);
            });

            var index = metadataManager.GetIndexInfo(tableName, _transaction);

            Assert.IsNotNull(index);
            Assert.AreEqual(0, index["Id"].BlocksAccessed());
            Assert.AreEqual(0, index["Id"].RecordsOutput());
        }