Better EXPLAIN QUERY PLAN for Operator::Search

This commit is contained in:
jussisaurio
2024-10-06 00:19:56 +03:00
parent 47534cb8df
commit dde10d2dd7

View File

@@ -426,8 +426,15 @@ impl Display for Operator {
}?;
Ok(())
}
Operator::Search { table, .. } => {
writeln!(f, "{}INDEX SCAN {}", indent, table.name)?;
Operator::Search { table_identifier, search, .. } => {
match search {
Search::PrimaryKeyEq { .. } | Search::PrimaryKeySearch { .. } => {
writeln!(f, "{}SEARCH {} USING INTEGER PRIMARY KEY (rowid=?)", indent, table_identifier)?;
}
Search::IndexSearch { index, .. } => {
writeln!(f, "{}SEARCH {} USING INDEX {}", indent, table_identifier, index.name)?;
}
}
Ok(())
}
Operator::Nothing => Ok(()),