문제

i create a virtual table for seaching text in database .

CREATE VIRTUAL TABLE testtable USING FTS3 (
id INTEGER, -- this field have duplicate values
test1 INTEGER,
test2 INTEGER,
test3 TEXT
)

this is word but when i want to search special id get very slow .
also i can't indexing "id" field and get a error :

virtual tables may not be indexed

want to search like this :

select * from testtable where id = 48880

how to make fastest search for this query, i search fast without FTS .

도움이 되었습니까?

해결책

On FTS tables, only FTS queries are fast.

The values in the id column are indexed as words, so you have to search for them as words:

SELECT * FROM testtable WHERE id MATCH '48880'
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top