You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn update_last_validation_timestamps(&self,hashes:Vec<FixedHash>) -> Result<(),OutputManagerStorageError>{let start = Instant::now();letmut conn = self.database_connection.get_pooled_connection()?;let acquire_lock = start.elapsed();// diesel::update(outputs::table.filter(outputs::hash.eq_any(hashes.iter().map(|hash| hash.to_vec()))))// .set(outputs::last_validation_timestamp.eq(Some(Utc::now().naive_utc())))// .execute(&mut conn)// .num_rows_affected_or_not_found(hashes.len())?;// TODO: This raw query is being evaluated, as the diesel query above is not as performant as expected.let sql_query = format!(r#" UPDATE outputs SET last_validation_timestamp = '{}' WHERE hash IN ({}) "#,Utc::now().naive_utc(),
hashes
.iter().map(|hash| format!("'{}'", hash.to_string())).collect::<Vec<_>>().join(","));
conn.batch_execute(&sql_query)?;
The text was updated successfully, but these errors were encountered:
Evaluate diesel vs. raw
The text was updated successfully, but these errors were encountered: