-
Notifications
You must be signed in to change notification settings - Fork 131
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
Counting entities in dynamodb #129
Comments
Ah yes, the |
Thank you for the quick response. Let me know if i can help in any way For reference: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html#DDB-Query-request-Select is the doc part describing COUNT. |
Will release a new version once Travis is green. |
Thanks for the report. The fix is now in version |
Thanks. Works like a charm. Keep up the great work |
laravel-dynamodb/src/DynamoDbQueryBuilder.php
Line 562 in b87ef60
Today we started using this class on one of our live products where we used dynamodb for simple logging only (reads on topics).
We only ever post the entry when the user reads the topic and read back a "read count" to display with each topic in the overview.
We had very low read and write rates before but after half a day of using the models instead of raw queries our read provision rates went trough the roof.
Turns out SomeModel::where('someField', $someValue)->count() doesn't actually result in a "Select" => "COUNT" statement to dynamodb but instead fetches all records and counts the collection.
Any chance this could be fixed?
Without a fix there is no point in using the model because all the clean code in the world can't justify a 50x increase in read provision rates
I'm willing to contribute a PR if wanted
The text was updated successfully, but these errors were encountered: