Improve run insert performance
This commit is contained in:
parent
2d255f2e06
commit
874ba5add6
1 changed files with 6 additions and 0 deletions
|
|
@ -68,6 +68,12 @@ async fn save_work(
|
||||||
.execute(&mut *conn)
|
.execute(&mut *conn)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
// Now that we know the commit exists, we can defer all other foreign key
|
||||||
|
// checks until the end of the transaction to improve insert performance.
|
||||||
|
sqlx::query!("PRAGMA defer_foreign_keys=1")
|
||||||
|
.execute(&mut *conn)
|
||||||
|
.await?;
|
||||||
|
|
||||||
for (metric, measurement) in run.measurements {
|
for (metric, measurement) in run.measurements {
|
||||||
sqlx::query!(
|
sqlx::query!(
|
||||||
"\
|
"\
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue