Domanda

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 .

È stato utile?

Soluzione

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'
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top