Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

@Query annotation to support query limiting #226

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

Closed
boostchicken wants to merge 3 commits into derjust:master from boostchicken:master

Conversation

@boostchicken
Copy link

@boostchicken boostchicken commented Jan 12, 2019

This will allow you to limit the results returned from a DynamoDB query that has a sort and range key, techincally also a Scan. I developed this to reduce cost b ased on the new OnDemand pricing.

Example:

@Query(limit = "10")
List<Blah> findFirst10ByStatusAndDateTimeBeforeOrderByDateTimeDesc(String Status, String DateTime);

The previous behavior would actually return every single result and then clip it. With this limit parameter dynamo only returns the request amount of results. This is mainly for HashAndRange. It still requires First10 and the Query annotation to work otherwise the Spring-DynamoDB will just do queries limited to 10 results until it gets them all.

derjust reacted with thumbs up emoji
Copy link
Author

image

A little look at how my query results return look based on this now. Also usage metrics are way down.

Copy link

codecov-io commented Jan 12, 2019
edited
Loading

Codecov Report

Merging #226 into master will increase coverage by 0.05%.
The diff coverage is 73.91%.

Impacted file tree graph

@@ Coverage Diff @@
## master #226 +/- ##
============================================
+ Coverage 67.31% 67.36% +0.05% 
- Complexity 656 658 +2 
============================================
 Files 83 83 
 Lines 2227 2246 +19 
 Branches 392 393 +1 
============================================
+ Hits 1499 1513 +14 
- Misses 549 553 +4 
- Partials 179 180 +1
Impacted Files Coverage Δ Complexity Δ
.../repository/support/DynamoDBEntityInformation.java 50% <ø> (ø) 1 <0> (ø) ⬇️
...y/query/DynamoDBEntityWithHashKeyOnlyCriteria.java 69.04% <100%> (+0.75%) 13 <0> (ø) ⬇️
...namodb/repository/query/PartTreeDynamoDBQuery.java 85.71% <100%> (ø) 10 <0> (ø) ⬇️
...epository/query/AbstractDynamoDBQueryCriteria.java 68.46% <100%> (+0.38%) 101 <1> (+1) ⬆️
...ynamodb/repository/query/DynamoDBQueryCreator.java 75% <100%> (+3.57%) 2 <1> (ø) ⬇️
...ery/DynamoDBEntityWithHashAndRangeKeyCriteria.java 74.3% <100%> (+0.14%) 74 <0> (ø) ⬇️
...db/repository/query/DynamoDBCountQueryCreator.java 44.44% <50%> (ø) 2 <1> (ø) ⬇️
...port/DynamoDBIdIsHashKeyEntityInformationImpl.java 72.72% <50%> (-2.28%) 9 <0> (ø)
...amoDBIdIsHashAndRangeKeyEntityInformationImpl.java 84% <50%> (-2.96%) 16 <0> (ø)
...repository/query/AbstractDynamoDBQueryCreator.java 49.05% <50%> (+0.03%) 11 <0> (ø) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bbc97ec...958236c. Read the comment docs.

Copy link
Author

boostchicken commented Jan 12, 2019
edited
Loading

image

A look at GSI read metrics after deployment.

Copy link
Owner

derjust commented Mar 10, 2019

Thank you so much.
Merged via #239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /