On 20 Oct 2013, at 12:23pm, Raheel Gupta <raheel...@gmail.com> wrote:
>> Yes, but they allow the searches to be faster. You are making it longer >> to do INSERT but shorter to do SELECT. Which is best for you depends on >> your purposes. > > I need the inserts to be faster. > So which is better ? An Index or a Primary Key ? A primary key is just an index which SQLite creates when it creates the table. Once it has been created it works the same as any other index that has the UNIQUE property. Not much timing difference in real life. I suspect that in the long term design it's better for you to keep SQLite's default integer primary key and define the index that helps your SELECT to operate quickly. If you really want to know the answer, try it both ways and time the results. It's not possible for us to predict the answer without intimate knowledge of your hardware and data. > The new INDEX that I created on your suggestion with d,n,s solves the > problem. > Now the question is over Primary key whether that will slow it down or not. Keep the index which solves the problem. DROP the ones which aren't being used. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users