最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Can I manually navigate through SQLite's index trees? - Stack Overflow

programmeradmin2浏览0评论

According to the documentation, SQLite internally uses a B-Tree to represent table indexes. Thus, if I have an index on columns A1 to A10, we can assume the values from those columns to somehow be distributed across this index tree.

Is there any way to "manually navigate" through these trees? My use case is some kind of a "fuzzy match", where I would gradually look at the different column values, assigning a fuzziness score for each match unless I exceed a cut-off value, and then pick the least fuzzy results.

(Note that the fuzziness would ultimately allow a large number of variations based on the original search term, making a full enumeration of all possibile matches undesirable. At the same time, the exact rules for what counts as a fuzzy match and what doesn't depend on user settings that can change for each query, hence a materialization of all possible paths also does not seem promising.)

Assuming the way SQLite's internal B-Trees are laid out would render such a stepwise approach possible1, could I even access them somehow using the API, and then move from node to node through the tree?

(Overall, my goal is having a B-Tree-like data structure stored on disk in such a way that performant inserts and, particularly, searches, can be done on it. This particular question aims at finding out whether I can leverage the implementation already integrated in SQLite for this purpose.)


1: I know this might not be the case - I do not know whether the indexed column values in the tree would appear in the same order as in the table, nor whether the tree would split the different columns into separate levels.

发布评论

评论列表(0)

  1. 暂无评论