Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@a8m
Copy link
Member

@a8m a8m commented Aug 27, 2021

In PostgreSQL, every statement is executed within a transaction. Therefore, we can avoid
creating transaction blocks manually (group of statements surrounded by BEGIN and COMMIT)
for DeleteNodes operation as it's implemented with a single statement.

Benchmark for 4000 operations was improved from:

14.54s      7270455 ns/op    3702 B/op     81 allocs/op

To:

5.36s      2679935 ns/op    2864 B/op     59 allocs/op

MySQL and SQLite share the same behavior. Please see #1858 for more info.

…ements

In PostgreSQL, every statement is executed within a transaction. Therefore, we can avoid
creating transaction blocks manually (group of statements surrounded by BEGIN and COMMIT)
for DeleteNodes operation as it's implemented with a single statement.

Benchmark for 4000 operations was improved from:

	14.54s      7270455 ns/op    3702 B/op     81 allocs/op

To:

	5.36s      2679935 ns/op    2864 B/op     59 allocs/op

---

MySQL and SQLite share the same behavior. Please see #1858
for more info.
@a8m a8m changed the title dialect/sql/sqlgraph: avoid creating tx blocks for single DELETE stat… dialect/sql/sqlgraph: avoid creating tx blocks for single DELETE statements Aug 27, 2021
@a8m a8m merged commit b23a0e8 into master Aug 27, 2021
@a8m a8m deleted the perf branch August 27, 2021 13:02
@rotemtam
Copy link
Contributor

💯😍💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants