Skip to content

SNOW-893080: session.bulk_save_objects does not put all objects in one INSERT #441

@markfickett

Description

@markfickett

Please answer these questions before submitting your issue. Thanks!

  1. What version of Python are you using?

Python 3.10.11 (main, Apr 5 2023, 14:15:10) [GCC 9.4.0]

  1. What operating system and processor architecture are you using?

Linux-5.14.0-1029-oem-x86_64-with-glibc2.31

  1. What are the component versions in the environment (pip freeze)?
alembic==1.10.4
pulumi==3.38.0
pulumi-snowflake==0.28.0
pymssql==2.2.7
PyMySQL==0.9.3
PyYAML==5.3.1
snowflake-connector-python==2.8.3
snowflake-sqlalchemy==1.4.7
SQLAlchemy==1.4.31
  1. What did you do?

Using the SqlAlchemy 1.4 bulk_save_objects API, I added 5000 objects in one SqlAlchemy session and then committed the session.

  1. What did you expect to see?

I expected to see one INSERT with 5000 VALUES rows. Instead, I see a variety of INSERT sizes, from 1 row to ~50 rows, and the insert of 5k objects takes 3+ minutes.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue is a request for improvement or a new featurestatus-triage_doneInitial triage done, will be further handled by the driver team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions