mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-10 11:44:22 +01:00
skip NULL in case of search over index
This commit is contained in:
@@ -1148,9 +1148,19 @@ fn emit_seek(
|
||||
// depending on the iteration direction.
|
||||
match seek_def.iter_dir {
|
||||
IterationDirection::Forwards => {
|
||||
program.emit_insn(Insn::Rewind {
|
||||
// the seek always has some bound condition over indexed column (e.g. c < ?, c >= ?, ...)
|
||||
// so, NULL always must be filtered out
|
||||
// (note, that complex filters like c < ? OR c IS NULL will produce Scan operation instead of Search)
|
||||
program.emit_insn(Insn::Null {
|
||||
dest: start_reg,
|
||||
dest_end: None,
|
||||
});
|
||||
program.emit_insn(Insn::SeekGT {
|
||||
is_index,
|
||||
cursor_id: seek_cursor_id,
|
||||
pc_if_empty: loop_end,
|
||||
start_reg,
|
||||
num_regs: 1,
|
||||
target_pc: loop_end,
|
||||
});
|
||||
}
|
||||
IterationDirection::Backwards => {
|
||||
|
||||
Reference in New Issue
Block a user