-
Notifications
You must be signed in to change notification settings - Fork 647
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
Scans and queries in @aws-sdk/client-dynamodb v3.928.0 and above are significantly slower in AWS Lambda compared to v3.927.0. For example, scanning ~8,000 items takes ~1,500ms in v3.927.0 but 6–10 seconds in v3.928+ versions. This regression appears in all versions starting with 3.928.0; earlier versions perform normally.
Regression Issue
- Select this option if this issue appears to be a regression.
SDK version number
@aws-sdk/client-dynamodb@3.927.0 (fast, baseline), @aws-sdk/client-dynamodb@3.928.0 and above (slow)
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
nodejs20.x
Reproduction Steps
Background:
Table contains ~8,000 items.
Average item size is ~1,100 KB.
Regression observed in @aws-sdk/client-dynamodb v3.928.0 and above.
Query example
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
const client = DynamoDBDocument.from(new DynamoDBClient({ region: "eu-north-1" }));
async function fetchAllQueryItems() {
const params = {
TableName: "YourTableName",
KeyConditionExpression: "pk = :pk",
ExpressionAttributeValues: { ":pk": "exampleKey" },
};
let items = [];
let lastEvaluatedKey;
do {
if (lastEvaluatedKey) params.ExclusiveStartKey = lastEvaluatedKey;
const response = await client.query(params);
items = items.concat(response.Items || []);
lastEvaluatedKey = response.LastEvaluatedKey;
} while (lastEvaluatedKey);
console.log("Total items fetched:", items.length);
}
fetchAllQueryItems().catch(console.error);
Observed Behavior
The code takes about 3-5 times longer to execute in v3.928.0 and above.
Expected Behavior
Fetching items should be as quick as it were while using v3.927.0 and below.
Possible Solution
No response
Additional Information/Context
No response