예제 #1
0
 // Group By Costs //
 /// <summary>
 /// Represents the cost to group data from an ordered stream
 /// </summary>
 /// <param name="RecordCount"></param>
 /// <param name="BuildIndex"></param>
 /// <returns></returns>
 public static double OrderedGroupByCost(long RecordCount, bool BuildIndex)
 {
     return((double)RecordCount + (BuildIndex ? CostCalculator.IndexBuildCost(RecordCount) : 0));
 }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="ARecordCount"></param>
 /// <param name="BRecordCount"></param>
 /// <param name="BuildLeftIndex"></param>
 /// <param name="BuildRightIndex"></param>
 /// <returns></returns>
 public static double SortMergeNestedLoopJoinCost(long ARecordCount, long BRecordCount, bool BuildLeftIndex, bool BuildRightIndex)
 {
     return((double)Math.Max(ARecordCount, BRecordCount)
            + (BuildLeftIndex ? CostCalculator.IndexBuildCost(ARecordCount) : 0)
            + (BuildRightIndex ? CostCalculator.IndexBuildCost(BRecordCount) : 0));
 }
예제 #3
0
 /// <summary>
 /// Returns the cost for performing a quasi-nested loop join
 /// </summary>
 /// <param name="ARecordCount"></param>
 /// <param name="BRecordCount"></param>
 /// <param name="BuildRightIndex"></param>
 /// <returns></returns>
 public static double QuasiNestedLoopJoinCost(long ARecordCount, long BRecordCount, bool BuildRightIndex)
 {
     return(ARecordCount * CostCalculator.LogN(BRecordCount) + (BuildRightIndex ? CostCalculator.IndexBuildCost(BRecordCount) : 0));
 }
예제 #4
0
 /// <summary>
 /// Returns the cost for building an index
 /// </summary>
 /// <param name="RecordCount"></param>
 /// <returns></returns>
 public static double IndexBuildCost(long RecordCount)
 {
     return(CostCalculator.SumLogI(RecordCount));
 }
예제 #5
0
 // Index Costs //
 /// <summary>
 /// Returns the cost for searching an index
 /// </summary>
 /// <param name="RecordCount"></param>
 /// <returns></returns>
 public static double IndexSeekCost(long RecordCount)
 {
     return(CostCalculator.LogN(RecordCount));
 }
예제 #6
0
 /// <summary>
 /// Represents the cost to group by using a dictionary
 /// </summary>
 /// <param name="RecordCount"></param>
 /// <returns></returns>
 public static double DictionaryGroupByCost(long RecordCount)
 {
     return((double)RecordCount + CostCalculator.IndexBuildCost(RecordCount));
 }