Table / Attribute / global_secondary_indexes

global_secondary_indexes#

DynamoDB.Table.global_secondary_indexes#
  • (list) –

    The global secondary indexes, if any, on the table. Each index is scoped to a given partition key value. Each element is composed of:

    • Backfilling - If true, then the index is currently in the backfilling phase. Backfilling occurs only when a new global secondary index is added to the table. It is the process by which DynamoDB populates the new index with data from the table. (This attribute does not appear for indexes that were created during a CreateTable operation.) You can delete an index that is being created during the Backfilling phase when IndexStatus is set to CREATING and Backfilling is true. You can’t delete the index that is being created when IndexStatus is set to CREATING and Backfilling is false. (This attribute does not appear for indexes that were created during a CreateTable operation.)

    • IndexName - The name of the global secondary index.

    • IndexSizeBytes - The total size of the global secondary index, in bytes. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

    • IndexStatus - The current status of the global secondary index:

      • CREATING - The index is being created.

      • UPDATING - The index is being updated.

      • DELETING - The index is being deleted.

      • ACTIVE - The index is ready for use.

    • ItemCount - The number of items in the global secondary index. DynamoDB updates this value approximately every six hours. Recent changes might not be reflected in this value.

    • 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 - In addition to the attributes described in KEYS_ONLY, the secondary index will include other non-key attributes that you specify.

        • 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 in NonKeyAttributes, 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.

    • ProvisionedThroughput - The provisioned throughput settings for the global secondary index, consisting of read and write capacity units, along with data about increases and decreases.

    If the table is in the DELETING state, no information about indexes will be returned.

    • (dict) –

      Represents the properties of a global secondary index.

      • IndexName (string) –

        The name of the global secondary index.

      • KeySchema (list) –

        The complete key schema for a global secondary index, which consists of one or more pairs of attribute names and key types:

        • HASH - partition key

        • RANGE - 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 one KeySchemaElement (for the partition key). A composite primary key would require one KeySchemaElement for the partition key, and another KeySchemaElement 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 key

            • RANGE - 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 in KEYS_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) –

      • IndexStatus (string) –

        The current state of the global secondary index:

        • CREATING - The index is being created.

        • UPDATING - The index is being updated.

        • DELETING - The index is being deleted.

        • ACTIVE - The index is ready for use.

      • Backfilling (boolean) –

        Indicates whether the index is currently backfilling. Backfilling is the process of reading items from the table and determining whether they can be added to the index. (Not all items will qualify: For example, a partition key cannot have any duplicate values.) If an item can be added to the index, DynamoDB will do so. After all items have been processed, the backfilling operation is complete and Backfilling is false.

        You can delete an index that is being created during the Backfilling phase when IndexStatus is set to CREATING and Backfilling is true. You can’t delete the index that is being created when IndexStatus is set to CREATING and Backfilling is false.

        Note

        For indexes that were created during a CreateTable operation, the Backfilling attribute does not appear in the DescribeTable output.

      • ProvisionedThroughput (dict) –

        Represents the provisioned throughput settings for the specified global secondary index.

        For current minimum and maximum provisioned throughput values, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

        • LastIncreaseDateTime (datetime) –

          The date and time of the last provisioned throughput increase for this table.

        • LastDecreaseDateTime (datetime) –

          The date and time of the last provisioned throughput decrease for this table.

        • NumberOfDecreasesToday (integer) –

          The number of provisioned throughput decreases for this table during this UTC calendar day. For current maximums on provisioned throughput decreases, see Service, Account, and Table Quotas in the Amazon DynamoDB Developer Guide.

        • ReadCapacityUnits (integer) –

          The maximum number of strongly consistent reads consumed per second before DynamoDB returns a ThrottlingException. Eventually consistent reads require less effort than strongly consistent reads, so a setting of 50 ReadCapacityUnits per second provides 100 eventually consistent ReadCapacityUnits per second.

        • WriteCapacityUnits (integer) –

          The maximum number of writes consumed per second before DynamoDB returns a ThrottlingException.

      • 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.