Subject Re: QUERY PLAN ?
Author Svein Erling Tysvær
Hi Adomas!

Normally, you would not specify a plan at all, but rather restrict the
choices the optimizer can choose between. E.g. if you had something
like

Select Name, Address
from Person
where PhoneNumber = '1234567890' and Country = 'China'

and the plan showed up as something like
PLAN(CountryIndex, PhoneIndex)

then I'd change parts of the SQL to

and Country || '' = 'China'

to prevent the use of that particular index.

If you need help to do this, then show us your SQL with the plan (and
a description of the indexes it uses), as well as the plan you think
is the most efficient.

HTH,
Set

> We got situation : we make selection from huge FB table, where is
> lots of indexes, so to optimize perfomance I need to make
> selection, with plan described.
> But, (TIBOQuery) after such actions : qr->Add(s), where
> s = "select * from A1 where..... PLAN(INDEX P1....) ORDER BY ....,
> qr->Open()
> I get error "index P1 cannot be used in specified plan". BUT same
> sql statement runs clearly in FB managers, such as Db Workbench,
> EMS Manager with no problems....
> Can I somehow solve it ?