I'm creating a SQLite Database for Android. I can do fairly simple SQL, but I haven't used an index before. I'm working on a table with >150,000 records and I've never dealt with a database so large. I know that I need to add at least one index to make my queries faster. Here is the table:
CREATE TABLE IF NOT EXISTS T ( a TEXT, b TEXT, c INT, d TEXT // ... 14 more TEXT columns )
My only queries on this table are only on a, b, and c like this:
SELECT * FROM T WHERE c = ? SELECT * FROM T WHERE a LIKE ?% AND b LIKE ?% SELECT * FROM T WHERE a LIKE ?% SELECT * FROM T WHERE b LIKE ?%
This table is filled once, and no changes are made to it after that. It's acceptable to take some extra time after import to add the index.
Can some one more knowledgeable than me tell me what index or indices I should create and if I should wait until after filling the table to add them?
This is my first question on this site. I thank you for you looking at this for me!