Reputation: 2827
If a query a table has no constraints, I think SQLite does a full-scan of the table. In this case how does it scan a table?
A table has at least one index, which is either rowid, a non-int key or some composed keys. Does SQLite need to traverse the indexed B+-tree for the scan? or can it jump to the leaves of the B-tree, and traverse only the leaves w/o going through those intermediate nodes?
Upvotes: 0
Views: 131
Reputation: 180020
In the database file, B-tree pages have no pointers to sibling pages (and the internal memory structures are organized in the same way), so a scan must go through the parent page(s). In practice, this is not a problem because the inner pages are more likely to be cached.
Upvotes: 1