Table / Attribute / local_secondary_indexes
local_secondary_indexes#
- DynamoDB.Table.local_secondary_indexes#
(list) –
Represents one or more local secondary indexes on the table. Each index is scoped to a given partition key value. Tables with one or more local secondary indexes are subject to an item collection size limit, where the amount of data within a given item collection cannot exceed 10 GB. Each element is composed of:
IndexName
- The name of the local secondary index.KeySchema
- Specifies the complete index key schema. The attribute names in the key schema must be between 1 and 255 characters (inclusive). The key schema must begin with the same partition key as the table.Projection
- Specifies attributes that are copied (projected) from the table into the index. These are in addition to the primary key attributes and index key attributes, which are automatically projected. Each attribute specification is composed of:ProjectionType
- One of the following:KEYS_ONLY
- Only the index and primary keys are projected into the index.INCLUDE
- Only the specified table attributes are projected into the index. The list of projected attributes is inNonKeyAttributes
.ALL
- All of the table attributes are projected into the index.
NonKeyAttributes
- A list of one or more non-key attribute names that are projected into the secondary index. The total count of attributes provided inNonKeyAttributes
, summed across all of the secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.
IndexSizeBytes
- Represents the total size of the index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.ItemCount
- Represents the number of items in the index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
If the table is in the
DELETING
state, no information about indexes will be returned.(dict) –
Represents the properties of a local secondary index.
IndexName (string) –
Represents the name of the local secondary index.
KeySchema (list) –
The complete key schema for the local secondary index, consisting of one or more pairs of attribute names and key types:
HASH
- partition keyRANGE
- sort key
Note
The partition key of an item is also known as its hash attribute. The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute. The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
(dict) –
Represents a single element of a key schema. A key schema specifies the attributes that make up the primary key of a table, or the key attributes of an index.
A
KeySchemaElement
represents exactly one attribute of the primary key. For example, a simple primary key would be represented by oneKeySchemaElement
(for the partition key). A composite primary key would require oneKeySchemaElement
for the partition key, and anotherKeySchemaElement
for the sort key.A
KeySchemaElement
must be a scalar, top-level attribute (not a nested attribute). The data type must be one of String, Number, or Binary. The attribute cannot be nested within a List or a Map.AttributeName (string) –
The name of a key attribute.
KeyType (string) –
The role that this key attribute will assume:
HASH
- partition keyRANGE
- sort key
Note
The partition key of an item is also known as its hash attribute. The term “hash attribute” derives from DynamoDB’s usage of an internal hash function to evenly distribute data items across partitions, based on their partition key values.
The sort key of an item is also known as its range attribute. The term “range attribute” derives from the way DynamoDB stores items with the same partition key physically close together, in sorted order by the sort key value.
Projection (dict) –
Represents attributes that are copied (projected) from the table into the global secondary index. These are in addition to the primary key attributes and index key attributes, which are automatically projected.
ProjectionType (string) –
The set of attributes that are projected into the index:
KEYS_ONLY
- Only the index and primary keys are projected into the index.INCLUDE
- In addition to the attributes described inKEYS_ONLY
, the secondary index will include other non-key attributes that you specify.ALL
- All of the table attributes are projected into the index.
When using the DynamoDB console,
ALL
is selected by default.NonKeyAttributes (list) –
Represents the non-key attribute names which will be projected into the index.
For local secondary indexes, the total count of
NonKeyAttributes
summed across all of the local secondary indexes, must not exceed 100. If you project the same attribute into two different indexes, this counts as two distinct attributes when determining the total.(string) –
IndexSizeBytes (integer) –
The total size of the specified index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
ItemCount (integer) –
The number of items in the specified index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.
IndexArn (string) –
The Amazon Resource Name (ARN) that uniquely identifies the index.