Subject Re: [Firebird-Architect] Can we, can we, can we????...
Author Alexandre Benson Smith
Nando Dessena wrote:

>J> How about limiting the number of fetches? We already track that, so a
>J> limit would be computationally cheap. Numbers ecords read is another
>J> possibility, but it would have to be records fetched rather than records
>J> returned. Number of update operations, maybe?
>
>The problem is that some "runaway queries" tend to waste a great deal of
>time doing things that don't depend on the number of records returned
>or updated, like scanning poorly selective indexes or collecting
>garbage... Number of reads sounds good to me, as it would be common to
>all 4 DML operations, wouldn't it?
>
>Ciao
>
>
Guys,

what could be done to stop a long query that returns few records ?

something like

select
*
from
A
where
A.ID in (select B.ID from B where B.SomeColumn = 'XPTO')

this query could run for a lot of time and return just a few rows.

Or it's just a case where the user should rewrite it in a better way like:

select
A.*
from
A join
B on (B.ID = A.ID)
where
B.SomeColumn = 'XPTO'

or do you mean number of page reads instead of valid (filtered) returned
records ?

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.9 - Release Date: 11/06/2005