Subject Re: [ib-support] Strange query problem
Author Lucas Franzen
Hi Alexander,


> I have a query:
>
> "select hist.cguid from con_discon_info hist"
>
> Table "con_discon_info" has an index on field "cguid".
> After query execution I can see in the performance monitor that all of
> the reads where non-indexed reads
>
> If I modify the querylike this:
>
> "select hist.cguid from con_discon_info hist group by cguid"
> ^^^^^^^^^^^^^^^
> All reads become indexed ?????
>
> Any ideas.

Yes, use order by instead of group by.

Just selecting an indexed field doesn't convince the optimizer to use
the index ;-)

Luc.