Subject | Re: [IBO] Search Data without refetching |
---|---|
Author | Helen Borrie |
Post date | 2006-04-30T00:28:31Z |
At 09:52 AM 30/04/2006, you wrote:
way to get this answer. Depending on what you want to do (just get
the answer, or get rows if they exist, otherwise IsEmpty) you could
use an existence query for maximum speed.
e.g. in a pair of stringlists. But that approach is not
efficient. It requires fetching the set first and afterwards
checking to see whether it has the data you want. That is desktop
database stuff. Locate doesn't work on an unbuffered dataset (and
it's inefficient on a buffered one).
With an IB_Query, you get a buffered dataset with a "moving
window". Locate will search the set and fetch more rows if it needs to.
IMO, you need to rethink what you want to achieve. If you are
interested only in rows that meet the date specification then target
only those rows, by parameterising the WHERE clause. Pulling a
dataset across and THEN testing it is very inefficient for this kind
of operation.
Helen
>I'm using an IB Cursor to retrieve a list of dates and times. Now IThen an IB_Cursor is the wrong choice, since it is unbuffered.
>need a very fast way to check the data (at most 200 hundred records)
>to see if a particular date and time is in it.
>I could use a parameterized query to check for individualI don't understand this. A parameterised query should be the fastest
>times(instead of getting the whole list), but this is too slow as the
>operation needs to run up to a few hundred times in a span that's
>imperceptible to the user.
way to get this answer. Depending on what you want to do (just get
the answer, or get rows if they exist, otherwise IsEmpty) you could
use an existence query for maximum speed.
>How can I search the data without having to go to the server toWith an IB_Cursor, you would have to store the results somewhere,
>refetch the results? Will using "locate" cause the data to be requeried?
e.g. in a pair of stringlists. But that approach is not
efficient. It requires fetching the set first and afterwards
checking to see whether it has the data you want. That is desktop
database stuff. Locate doesn't work on an unbuffered dataset (and
it's inefficient on a buffered one).
With an IB_Query, you get a buffered dataset with a "moving
window". Locate will search the set and fetch more rows if it needs to.
IMO, you need to rethink what you want to achieve. If you are
interested only in rows that meet the date specification then target
only those rows, by parameterising the WHERE clause. Pulling a
dataset across and THEN testing it is very inefficient for this kind
of operation.
Helen
>___________________________________________________________________________
>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
>
>
>
>