Question

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 .

Was it helpful?

Solution

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'
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top