Subject | Re: [IBO] IBOQuery performance issue with Key select |
---|---|
Author | Helen Borrie |
Post date | 2008-11-25T12:14:21Z |
At 10:57 PM 25/11/2008, you wrote:
If you do this in the proper client/server way, the Keyfields[] array will make successive runs of this query much faster. It is also important in the implementation of the buffering mechanism that IBO operates between your app and the waiting rows in the server's buffer, something that lightly implemented interfaces like UIB don't support. Amongst other things, it gives you "insert in place", which for users is highly preferable to Append.
Don't run select * queries unless you really *want* all of the columns of a table; and always use a WHERE clause, with parameters.
Helen
>Hello,Always set KeyLinks and always use parameterised queries. Avoid constructing static queries in run-time.
>
>I've a problem, that greatly reduces performance of select using
>IBOQuery. The problem is with wome internal stuff of IBOQuery
>implementation.
>
>When I pass a select statement to query, it apears (using IB_Monitor),
>that it first selects key fields, specified in KeyLinks property or
>RDB$DB_KEY, if none are specified. Only then it selects real data.
>What I see is that all this extra stuff is much slower, than the select
>itself.
>
>Results of my tests:
>When KeyLinks is empty: 6+ sec.
>When KeyLinks are set: 4.5 sec.
>
>If i use a Query component from UIB components, the same select
>statement is executed in about 0.75 sec., so its a huge difference
>compared to IBO. Unfortunately, I have hundreds of lines of written and
>tested code, so switching to other components is painful.
>
>Is there any way to change the behaviour of IBOQuery, so that it would
>just execute the statement and not do all those "smart" things? Or any
>other suggestions?
If you do this in the proper client/server way, the Keyfields[] array will make successive runs of this query much faster. It is also important in the implementation of the buffering mechanism that IBO operates between your app and the waiting rows in the server's buffer, something that lightly implemented interfaces like UIB don't support. Amongst other things, it gives you "insert in place", which for users is highly preferable to Append.
Don't run select * queries unless you really *want* all of the columns of a table; and always use a WHERE clause, with parameters.
Helen
>--
>Aurimas
>
>------------------------------------
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more ! Yahoo! Groups Links
>
>
>