You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have table with more than 20+ columns, total table size is 1.3 MB, total item count is 291 with average item size of 4,636.77 bytes
I also implemented a GSI so I can use a query instead of scan but when I run my lambda the response time is 5-7 seconds.
I also configured the dynamodb tables to be on demand.
I tried also these two approach.
Using dynamoose to query table - this returns 5-7 seconds
Using DynamoDb.DocumentClient - this returns milliseconds to 2 seconds.
This is the screenshot from dynamodb console table
CustomPoisDynamoDBTable:
Type: "AWS::DynamoDB::Table"
Properties:
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: uid
AttributeType: S
- AttributeName: version
AttributeType: N
- AttributeName: status
AttributeType: S
- AttributeName: name
AttributeType: S
KeySchema:
- AttributeName: uid
KeyType: HASH
- AttributeName: version
KeyType: RANGE
TableName: custom_pois
GlobalSecondaryIndexes:
- IndexName: "status_name_index"
KeySchema:
- AttributeName: status
KeyType: HASH
- AttributeName: name
KeyType: RANGE
Projection:
ProjectionType: ALL
Current output and behavior (including stack trace):
I'm expecting that adding GSI and using query should be faster
Expected output and behavior:
I'm expecting that dynamoose query should be faster since I added already a GSI.
I tried using the built in Dynamodb Document Client query and it's faster.
Environment:
Operating System:
Operating System Version: Apple M1
Node.js version (node -v): 16.18
NPM version: (npm -v): 8.19.2
Dynamoose version: 3.1.0
Other information (if applicable):
I also tried using the normal dynamodb document client query using the syntax
Summary:
I have table with more than 20+ columns, total table size is 1.3 MB, total item count is 291 with average item size of 4,636.77 bytes
I also implemented a GSI so I can use a
query
instead of scan but when I run my lambda the response time is 5-7 seconds.I also configured the dynamodb tables to be on demand.
I tried also these two approach.
This is the screenshot from dynamodb console table
Code sample:
Schema
models/concerns/initDB.js
models/concerns/custom_pois.js
Model
General
This is my Lambda Function.
serverless.yml
Current output and behavior (including stack trace):
I'm expecting that adding GSI and using query should be faster
Expected output and behavior:
Environment:
Operating System:
Operating System Version: Apple M1
Node.js version (
node -v
): 16.18NPM version: (
npm -v
): 8.19.2Dynamoose version: 3.1.0
Other information (if applicable):
I also tried using the normal dynamodb document client query using the syntax
Other:
The text was updated successfully, but these errors were encountered: