Hello! On Sunday 11 October 2009 12:04:37 Ron Arts wrote: > CREATE TABLE company(id INTEGER PRIMARY KEY ASC, name) > > Then I insert 500000 records like this: > > INSERT INTO company (id, name) VALUES ('1', 'Company name number 1') > > (with consecutive values for the id value.) > > do you expect the id column now to be mapped to the Row ID, so > this results in the fastest possible way of selecting by id?
Yes, the id is alias for rowid in your table. Check it by sqlite3 > explain query plan select name from company where id=1; > I now get this: > > sqlite3 prepared insert in trx 500000 records time: 5.08 secs > sqlite3 select 500000 records time: 19.28 secs > sqlite3 prepared select 500000 records time: 3.47 secs > glib2 hash tables insert 500000 records time: 0.37 secs > glib2 hash tables lookup 500000 records time: 0.25 secs > > But I'm still looking to speed up selects. Hm... I think you may not open more than 8 000 tcp/ip sockets per second in common case and so SQLite speed is good enough. Why you write about "to handle tens of thousands requests per second"? Best regards, Alexey Pechnikov. http://pechnikov.tel/ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users