mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-10 10:44:22 +01:00
perf/vdbe: avoid doing work in commit_txn if not in txn
This commit is contained in:
@@ -445,6 +445,11 @@ impl Program {
|
||||
mv_store: Option<&Arc<MvStore>>,
|
||||
rollback: bool,
|
||||
) -> Result<StepResult> {
|
||||
if self.connection.transaction_state.get() == TransactionState::None && mv_store.is_none() {
|
||||
// No need to do any work here if not in tx. Current MVCC logic doesn't work with this assumption,
|
||||
// hence the mv_store.is_none() check.
|
||||
return Ok(StepResult::Done);
|
||||
}
|
||||
if let Some(mv_store) = mv_store {
|
||||
let conn = self.connection.clone();
|
||||
let auto_commit = conn.auto_commit.get();
|
||||
|
||||
Reference in New Issue
Block a user