Subject Re: Aborting isc_dsql_execute calls from another thread (Win32)
Author Adam
--- In firebird-support@yahoogroups.com, Richard Wesley
<hawkfish@...> wrote:
>
>
> On Mar 22, 2006, at 13:13, Alan McDonald wrote:
>
> >> If I am executing a select query via isc_dsql_execute in a
background
> >> thread under Windows, what is the best way to abort the
execution if
> >> the user cancels the operation in a foreground thread? Can I
issue a
> >> rollback on the transaction? Do I just orphan the execution
thread
> >> until it completes? Or is there some other mechanism?
> >>
> >> TIA,
> >> ________________________________________________________
> >> Richard Wesley Software Engineer
> >
> > how are you fetching the rows? you can fetch in a loop and
> > interrupt the
> > loop, then rollback the transaction.
>
> I guess the question is "Where is all the time spent executing a
slow
> query"? I had assumed that all Fetch did was read a data stream
that
> had already been created. Is that not the case?

Another thought. Is it a simple query or do you have an order by
statement or a group by statement that can not use an index. A
statement that ordered by a non indexed field would need to read
every record (and possibly join tables) before returning the first
record.

Adam