Subject Re: [IBO] SQL plan in TIBOQuery
Author Raymond Kennington
"hubert_krukowski " wrote:
>
> Hi,
>
> Is there any way I can access (read and write) the SQL plan for the
> TIBOQuery? The optimizer comes up with some horrible one and if I do
> not change it I end up waiting 10 minutes for a query to finish. The
> query component is linked to DevExpress grid and its
> OrderingLinks/OrderingItems are set at runtime to facilitate grid
> sorting.
> Any ideas?
>
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.)

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.

Are you using the DevExpress grid to load all data or just the data you need?
--
Raymond Kennington
Programming Solutions
W2W Team B