Skip to content

Have the option to use DELETE statements for Postgres to increase performance #126

@relfman-cmg

Description

@relfman-cmg

Hi,

I have the a scenario for integration tests where each test clears the DB for approx 40 tables. It takes 200-300ms which adds up over multiple tests. The tables have barely any rows in them per each test, however when I had wrote a query with multiple DELETE FROM CASCADE statements it's ~30ms.

See this for more details: https://www.lob.com/blog/truncate-vs-delete-efficiently-clearing-data-from-a-postgres-table

It would be good to have the option to flip between TRUNCATE and DELETE depending if you have lots of rows or very little

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