Skip to content

Commit

Permalink
made optimization (#1289)
Browse files Browse the repository at this point in the history
  • Loading branch information
bchong95 authored Mar 23, 2020
1 parent 37d054b commit 81a3208
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ namespace Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.OrderBy

internal sealed partial class CosmosOrderByItemQueryExecutionContext : CosmosCrossPartitionQueryExecutionContext
{
private const string TrueFilter = "true";

private static class Expressions
{
public const string LessThan = "<";
Expand Down Expand Up @@ -599,7 +601,9 @@ private static (string leftFilter, string targetFilter, string rightFilter) GetF
}
}

return (left.ToString(), target.ToString(), right.ToString());
// For the target filter we can make an optimization to just return "true",
// since we already have the backend continuation token to resume with.
return (left.ToString(), TrueFilter, right.ToString());
}

private readonly struct OrderByInitInfo
Expand Down

0 comments on commit 81a3208

Please sign in to comment.