Uh oh!
There was an error while loading. Please reload this page.
fix: Report per-index consumed capacity for writes (excludes transact/batch APIs for now) - #199
Conversation
pdf-amzn
commented
Jul 2, 2026
Nice fix — the per-index capacity accounting is correct and the tests are solid. One architectural concern and a few minor items: Main concern: redundant The engine already fetches pubstructIndexInfo{pubindex_name:String,pubkey_schema:Vec<KeySchemaElement>,pubprojection:Projection,}pubstructTableKeyInfo{// ... existing fields ...pubglobal_secondary_indexes:Vec<IndexInfo>,publocal_secondary_indexes:Vec<IndexInfo>,}Since The current approach is functionally correct, but we do care enough about performance that I think we shoiudl do something here; enriching Minor items (non-blocking):
|
LeeroyHannigan
commented
Jul 2, 2026
Can we rebase this on #128 as the index logic may differ a lot once it lands? |
Source secondary-index metadata from cached TableKeyInfo to avoid per-write catalog reads. Account for old and new index transitions while preserving response shapes, and cover GSI and LSI projection edge cases.
5453840 to
fff80f2Comparerobinnsc
commented
Jul 29, 2026
Addressed the feedback and rebased:
|
Uh oh!
There was an error while loading. Please reload this page.
What
Implementing index consumed capacity accounting for the single item write operations: PutItem, UpdateItem, DeleteItem
Deferred Changes
Support for per index breakdowns for TransactWriteItems and BatchWriteItem not included, as it requires some material further changes in the storage layer with DataEngine traits, will be addressed in a followup. Also, exact byte sizing would still be a broader issue, and will resolved its own item size formula gap fix
Why
Requests with the
ReturnConsumedCapacityparameter set to 'INDEXES' on a table with secondary indexes was returning only the base table number, with no per-index breakdown.TOTALmode also under counted, reporting only the base-table units.ConsumedCapacity was previously hardcoded as none for GSIs/LSIs, so the breakdown was never populated and the aggregate never included index writes.
Testing done
Checklist
cargo test --workspace)cargo fmt --check)cargo clippy -- -W clippy::pedantic)Storagetrait, auth model, on-diskformat, or public CLI surface, an RFC has been accepted or is linked
below. Otherwise, an ADR captures the decision (link below).
By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache License 2.0 and I agree to the Developer Certificate of
Origin (DCO). See CONTRIBUTING.md for details.