On Thu, 2009-08-13 at 23:39 -0400, Igor Tandetnik wrote:
> Kermit Mei wrote:
> > The mostly useful SQL sentence is (MyDevId is known by user):
> >
> > SELECT * FROM KeyItem WHERE HomeDevId=MyDevId order by pageNum;
> >
> > Now, the items of this table may be more than 100,000 lines. If I use
> > the following Index, can it improve the previous query's speed?
> >
> > CREATE INDEX index_KeyItem_HP ON KeyItem(HomeDevId, pageNum ASC);
> 
> Yes, this should help.
> 
> > I use index firstly, so I don't know how to manipulate it? Just
> > create a index like this, or any more operation is needed?
> 
> No, just creating the index should be enough. SQLite should use it 
> automatically if it's beneficial for a particular query.
> 
> Igor Tandetnik 

Yes, I see. Thank you, Tandetnik.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to