Skip to content

DescribeTable call hidden in read_items #2396

Open
@mooreniemi

Description

@mooreniemi

I'm using read_items but inside that call is another API call. Can this be avoided?

table_key_schema = get_table(table_name=table_name, boto3_session=boto3_session).key_schema

To:

To:

dynamodb_table = dynamodb_resource.Table(table_name)

When I enable debug logging (boto3.set_stream_logger(name='botocore') and call table.key_schema I see:

2023-07-18 09:19:42,633 botocore.hooks [DEBUG] Event request-created.dynamodb.DescribeTable: calling handler <function add_retry_headers at 0x1a316ec20>

This means every read_items call is doing this extra lookup. Could an option be added to provide the key_schema explicitly? Only so many items can be provided to read_items (100 max) so it's guaranteed that for someone using this library they're going to make this extra call 1% of their requests - if they're doing massive read traffic in the millions this adds up.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions