Can the LIKE statement be optimized to not do full table scans?
问题 I want to get a subtree from a table by tree path. the path column stores strings like: foo/ foo/bar/ foo/bar/baz/ If I try to select all records that start with a certain path: EXPLAIN QUERY PLAN SELECT * FROM f WHERE path LIKE "foo/%" it tells me that the table is scanned, even though the path column is indexed :( Is there any way I could make LIKE use the index and not scan the table? I found a way to achieve what I want with closure table, but it's harder to maintain and writes are