"B V, Phanisekhar" <[EMAIL PROTECTED]> wrote:
> Assume a table
> 
>  create table Title (
>    Id INTEGER PRIMARY KEY,
>    Titlename BLOB
>  )
>  create unique index TitleIdx ON Title (Titlename)
> 
> For which all queries index "TitleIdx" will be used?
> 
> (1) select Titlename from Title order by Titlename
> (2) select Titlename from Title where id in (...) 
>      order by Titlename
> (3) select Titlename from Title order by Titlename
>       limit 3 offset 10
> 

I believe the answer is (1) and (3).  You can add
the phrase "explain query plan" before each query
and the output will show you which index is used.


--
D. Richard Hipp <[EMAIL PROTECTED]>


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to