Subject Re: [IBO] SQL plan in TIBOQuery
Author Raymond Kennington
"hubert_krukowski " wrote:
>
> > When you change the query for the grid by changing the order for
> sorting, first
> > prepare it and then use the IB_Query.SQLPlan property to provide
> your own. (I
> > haven't tried this, just read the Help file.)
>
> SQLPlan is available in IB_Query but not in IBOQuery I am using. I
> have to use IBOQuery as it is a TDataset descendant and I do not
> have to modify all the visual controls in the app.
>
> > Another thing you can do is anticipate all the possible orders and
> provide
> > indexes for them so that the optimiser has something better to
> choose from.
>
> I do have correct indexes. I even know the correct plan for the
> sorting in question. The problem is Interbase optimizer does know
> it :-)

(I think Firebird's optimiser has been improved significantly, but that won't
help you unless you switch.)

IBOQuery has the property Plan, instead of SQLPlan.

There is also an event OnPrepare... that might be useful to you. I don't know if
it has finished preparing or is fired after preparing (as the Help file doesn't
state this info).
--
Raymond Kennington
Programming Solutions
W2W Team B