Пример #1
0
        private bool TemporaryIndexShouldBeMadePermanent(TemporaryIndexInfo indexInfo)
        {
            if (indexInfo.RunCount < documentDatabase.Configuration.TempIndexPromotionMinimumQueryCount)
            {
                return(false);
            }

            var timeSinceCreation = SystemTime.UtcNow.Subtract(indexInfo.Created);
            var score             = timeSinceCreation.TotalMilliseconds / indexInfo.RunCount;

            return(score < documentDatabase.Configuration.TempIndexPromotionThreshold);
        }
Пример #2
0
		private bool TemporaryIndexShouldBeMadePermanent(TemporaryIndexInfo indexInfo)
		{
			if (indexInfo.RunCount < documentDatabase.Configuration.TempIndexPromotionMinimumQueryCount)
				return false;

			var timeSinceCreation = DateTime.Now.Subtract(indexInfo.Created);
			var score = timeSinceCreation.TotalMilliseconds / indexInfo.RunCount;

			return score < documentDatabase.Configuration.TempIndexPromotionThreshold;
		}