Skip to content

Performance improvement on paginated query for CosmosDB

Neelesh Thakur requested to merge pageable-honor-size into master

Overview


This MR contains an alternative implementation of CosmosStore.queryItemsPage method. Previous implementation have two interactions with a BlockingIterable object that could be reduced to one without lose of meaning. The purpose of such strategy is performance gain once such interactions are time consumers due to its blocking nature.

During the performance tests, we collected the following values

Previous Implementation of CosmosStore.queryItemsPage Latest Implementation of CosmosStore.queryItemsPage
Batch Size 10000 TOTAL OPERATION TIME (MS): 249680 TOTAL OPERATION TIME (MS): 127606
Batch Size 5000 TOTAL OPERATION TIME (MS): 332617 TOTAL OPERATION TIME (MS): 180620
Batch Size 2500 TOTAL OPERATION TIME (MS): 368768 TOTAL OPERATION TIME (MS): 193582
Batch Size 1000 TOTAL OPERATION TIME (MS): 448730 TOTAL OPERATION TIME (MS): 240568

This changeset also introduces changes to honor page size for continuation token query and log RUs for that page size.

All Submissions:


  • [YES] I have added an explanation of what changes in this merge do and why we should include it?
  • [YES] I have updated the documentation accordingly.
  • [YES] I have added tests to cover my changes.
  • [YES] All new and existing tests passed.
  • [YES] My code follows the code style of this project.
  • [YES] I ran lint checks locally prior to submission.

What is the issue or story related to the change?


It was added a new method but no behavior has been changed once the old queryItemsPage was not deleted. It just

High level design:

Issue: 28

Does this introduce a breaking change?


  • [NO]
Edited by Rafael Freire

Merge request reports