Skip to content

[Question] how is this performance-wise compared to df.to_sql(method='multi')? #23

Description

@lefnire

From reading around, it seems INSERT .. ON CONFLICT) is higher-performance than DELETE .. INSERT .., which is how I'm doing things now, so this library is compelling. However, one big boon of df.to_sql is method='multi', which creates a big-ol' insert statement rather than individual ones, which (combined with chunksize) I've found improves my bulk-insert performance massively. I realize this is more a question about sqlalchemy.dialects.postgresql.insert, but I'm asking here because - being less familiar with that method - I don't see any arguments that can be passed to pangres.upsert for managing the insert approach. Eg, I see postgresql.insert(inline=True) might be something along these lines? Or does postgresql.insert handle like that by default?

TL;DR: is pangres as fast as df.to_sql(method='multi'), or are there plans to add a options which get passed to sqlalchemy..postgresql for performance management? (Does this make sense?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions