thanks a lot for your help !

Nathan Kurz <[EMAIL PROTECTED]> 写道: On Mon, Dec 12, 2005 at 09:48:21AM +0800, 
Bo Lin wrote:
> Here is a sql string ,like : select * from test where (a=0 or a=1)
> and b=1 ; and column a range from 1-10000, and column b range from
> 0-1.  and DB has about 300,000 record with colum a and b configured
> randomly .
>
> Two index is create on "test" table . First is on "column b" and the
> second is on "a,b"
>
>  but when I try to use "explain" , I found the first index is
> used. but obviousely if sqlite can use the second index , the
> performance can be improved a lot .
>
>  how can I use the second index, can sqlite can support "select" to
> specify certain index ?

I'm sorry I can't just offer you the correct answer, but have you
looked at ?  It gives some good
hints on how to the choice of indices is made.

Good luck,

--nate



                
---------------------------------
 雅虎免费G邮箱-中国第一绝无垃圾邮件骚扰超大邮箱
 雅虎助手¨D搜索、杀毒、防骚扰  

Reply via email to