mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-07 17:24:24 +01:00
Prevent using a partial index as a scan driver
This commit is contained in:
@@ -361,6 +361,15 @@ pub fn constraints_from_where_clause(
|
||||
candidate.refs.truncate(first_inequality + 1);
|
||||
}
|
||||
}
|
||||
cs.candidates.retain(|c| {
|
||||
if let Some(idx) = &c.index {
|
||||
if idx.where_clause.is_some() && c.refs.is_empty() {
|
||||
// prevent a partial index from even being considered as a scan driver.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
true
|
||||
});
|
||||
constraints.push(cs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user