Questions tagged [amazon-dynamodb-index]
251 questions
3
votes
2 answers
DynamoDB: Querying all similar items of a certain type
Keeping in mind the best practices of having a single table and to evenly distribute items across partitions using as unique partition keys as possible in DynamoDB, I am stuck at one problem.
Say my table stores items such as users, items and…

Syed Waqas
- 2,576
- 4
- 29
- 36
3
votes
1 answer
Are GSI on Global table of dynamodb replicated automatically?
I have a gsi defined ( in usw2 region) of a global table that is configured to replicate automatically to use2 . I have a gsi defined in usw2 for my table - will the index be replicated automatically ? or do i need go create that manually in the…

redzedi
- 1,957
- 21
- 31
3
votes
1 answer
AWS DynamoDB Backwards Scanning Ignores LastEvaluatedKey
I am using AWS for hosting an API with API Gateway and DynamoDB direct integration.
I am trying now to add the pagination feature for my app, and I am having a hard time to implement it 100%.
The problem that I'm facing is when I scan backwards,…

Juan Rivillas
- 897
- 2
- 9
- 23
3
votes
1 answer
In DynamoDB, which is faster? Querying by Id or by a secondary index attribute?
I have a DynamoDB table where I need to query on two different attributes, sometimes by one, sometimes by the other one, but never by both at the same time.
Let's say I have an attribute A and attribute B, other attributes are irrelevant here.
I'm…

danilobraga
- 165
- 1
- 9
3
votes
0 answers
how to mark an attribute as both DynamoDBRangeKey and DynamoDBIndexHashKey?
I have a range key field that is also an GSI. Does anybody know how to annotate this attribute with DynamoDBMapper?
FYI, I tried putting both @DynamoDBRangeKey and @DynamoDBIndexHashKey annotations on like below, and it gave an "no RANGE key value…

saksham jain
- 33
- 6
3
votes
2 answers
Modeling Relational Data in DynamoDB (nested relationship)
Entity Model:
I've read AWS Guide about create a Modeling Relational Data in DynamoDB. It's so confusing in my access pattern.
Access Pattern
+-------------------------------------------+------------+------------+
| Access Pattern …

Long Nguyen
- 9,898
- 5
- 53
- 52
3
votes
2 answers
How to get the total number of records count present in dynamodb using Resolver in Appsync
I am new to Dynamodb and Appsync I have one table named User with fields
id and name as follow
type User {
id: ID! // auto-generated
name: String }
By using the mutation I inserted 5 records. Now my query is how do I get the count of the number of…

Bharath Kuppala
- 176
- 1
- 3
- 14
2
votes
1 answer
DynamoDB paginated data retrieval
I have the following columns and its purpose.
id -> stores the timestamp of modification
authorName -> saves the user name who have modified
authorEmail -> saves the user email who have modified
version -> value denoting the version number
Data ->…

Mandar Kulkarni
- 41
- 3
2
votes
1 answer
Storage cost / supportability / performance tradeoffs using compact attributes in DynamoDB
I'm working on large scale component that generates unique/opaque tokens representing business entities. Over time there will be many billions of these records, but for the first year we're not expecting growth to exceed more than 2 billion…

user1016765
- 2,935
- 2
- 32
- 48
2
votes
1 answer
DynamoDbException: Too many decomposed read operations for a given query
When using a PartiQL query which looks like this:
SELECT * FROM my_table WHERE my_field IN [1, 2, 3...]
I received this error which I can't find anywhere in Google and doesn't tell me anything about how to resolve the problem:
DynamoDbException: Too…

Alex
- 7,639
- 3
- 45
- 58
2
votes
2 answers
Query all users in DynamoDB with a single-table design
I have a simple single-table design that I want to keep flexible for the future, I currently have 2 entity types: users and videos. Users have a 1:n relationship to videos.
The table's partition key is pk and sort key is sk.
Users: pk=u# and…

PGT
- 1,468
- 20
- 34
2
votes
1 answer
DynamoDb Put item with a condition check on GSI
I have dynamodb table with GSI as the following:
ParentId#ChildName
2346#John
2388#Jerry
Now I want to add a new time to the table where parentId = 2388 and ChildName = Tom, before adding this item I want to make sure that the GSI…

Arun Kumar
- 23
- 5
2
votes
2 answers
Using millisecond timestamp as the global secondary index in DynamodDb for range queries?
We have a Dynamodb table Events with about 50 million records that look like this:
{
"id": "1yp3Or0KrPUBIC",
"event_time": 1632934672534,
"attr1" : 1,
"attr2" : 2,
"attr3" : 3,
...
"attrN" : N,
}
The Partition Key=id and there is no Sort…

J-Deq87
- 101
- 10
2
votes
1 answer
DynamoDB date GSI
I have a DynamoDB table that stores executions of some programs, this is what it looks like:
Partition Key
Sort Key
StartDate
...
program-name
execution-id (uuid)
YYYY-MM-DD HH:mm:ss
...
I have two query scenarios for this table:
Query…

Pedro Henrique
- 680
- 7
- 22
2
votes
1 answer
Sorting not supported for scan expressions and no HASH key for GSI for DynamoDBPagingAndSortingRepository
I think I have tried all kind of combinations of annotation but I am getting either Sorting not supported for scan expressions or no HASH key for GSI or Both the Hash Key and the Range Key element in the KeySchema have the same name…

Prem
- 316
- 1
- 5
- 23