Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ORDER BY Resume Optimization #1289

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a changelog note that there is a query optimization.

// since we already have the backend continuation token to resume with.
return (left.ToString(), TrueFilter, right.ToString());
bchong95 marked this conversation as resolved.
Show resolved Hide resolved
}

private readonly struct OrderByInitInfo
Expand Down