4 ms·
Out of curiosity, would placing all DELETE queries within a single transaction also help? Or does that still cause PostgreSQL to process each of the queries seq
by EdSchouten 2y ago
Out of curiosity, would placing all DELETE queries within a single transaction also help? Or does that still cause PostgreSQL to process each of the queries sequentially?
- londons_explore 2y agoseperate queries within a transaction aren't optimized together. It wouldn't help (apart from possibly some caching benefits).
- peter_l_downs 2y agoNo — most constraint checks are by default deferred until the end of the transaction, but you'd still need to check them, and without an index you'll still have to do a large scan. See https://www.postgresql.org/docs/17/sql-set-constraints.html https://www.postgresql.org/docs/17/sql-set-constraints.html for more information regarding constraint checking.