Subject | Re: Execute Statement eating memory |
---|---|
Author | pi3k14 |
Post date | 2006-01-12T13:00:44Z |
--- In firebird-support@yahoogroups.com, Helen Borrie <helebor@t...>
wrote:
(performed in a procedure)
SELECT COUNT(*)
FROM Bunke
WHERE Aar = :Aar AND Bilagsserie = :Bilagsserie AND :Bilag =
Bilag
AND Motpartkategori IS NOT NULL
AND ( Konto = :Konto AND Dato = :Dato AND Linje < :
Bunkelinje )
AND EXISTS( SELECT *
FROM HentDimSaldoBalanse( 'B', Bunke.Id
)
WHERE Dimensjoner = :Dimensjoner )
INTO Reskontrolinje;
It is the EXISTS statement that "breaks the server", it seems like it
consumes a lot of memory for each invocation.
HentDimSaldoBalanse is simplified to just return the string '#'.
When inserting an Exception statement just after this select I got the
message "No current record for fetch operation" before my exception
info was output (Using IBObjects).
When this statement is run from IBOConsole no errors are reported,
when rewriting it to
SELECT COUNT(*)
FROM Bunke
JOIN HentDimSaldoBalanse( 'B', Bunke.Id )
ON Dimensjoner = :Dimensjoner
WHERE Aar = :Aar AND Bilagsserie = :Bilagsserie AND Bilag = :
Bilag
AND Linje < :Bunkelinje AND Dato = :Dato AND Konto = :
Konto
AND Motpartkategori IS NOT NULL
IBOConsole gives the same error, but this works in the procedure (no
memory "trashing").
Since I can't try this from IBOConsole I'm not sure if the rewrite is
correct.
Is there anything obvious wrong with what I am doing?
frode
wrote:
>case,
> At 01:05 PM 11/01/2006 +0000, you wrote:
> >Hi,
> >I have some code like EXECUTE STATEMENT 'EXECUTE PROCEDURE blabla'
> >
> >While running this my pagefile grows until available disk space is
> >exhausted.
> >
>
> You're running what's sometimes known as "a runaway query" - in this
> the procedure logic is probably executing an infinite loop. Showthe
> actual code of the two procedures so that it's possible to commenton what
> the procedure is *actually* doing, rather than what you think itought to do...
>I have nailed down the cause for this, it is the following select
(performed in a procedure)
SELECT COUNT(*)
FROM Bunke
WHERE Aar = :Aar AND Bilagsserie = :Bilagsserie AND :Bilag =
Bilag
AND Motpartkategori IS NOT NULL
AND ( Konto = :Konto AND Dato = :Dato AND Linje < :
Bunkelinje )
AND EXISTS( SELECT *
FROM HentDimSaldoBalanse( 'B', Bunke.Id
)
WHERE Dimensjoner = :Dimensjoner )
INTO Reskontrolinje;
It is the EXISTS statement that "breaks the server", it seems like it
consumes a lot of memory for each invocation.
HentDimSaldoBalanse is simplified to just return the string '#'.
When inserting an Exception statement just after this select I got the
message "No current record for fetch operation" before my exception
info was output (Using IBObjects).
When this statement is run from IBOConsole no errors are reported,
when rewriting it to
SELECT COUNT(*)
FROM Bunke
JOIN HentDimSaldoBalanse( 'B', Bunke.Id )
ON Dimensjoner = :Dimensjoner
WHERE Aar = :Aar AND Bilagsserie = :Bilagsserie AND Bilag = :
Bilag
AND Linje < :Bunkelinje AND Dato = :Dato AND Konto = :
Konto
AND Motpartkategori IS NOT NULL
IBOConsole gives the same error, but this works in the procedure (no
memory "trashing").
Since I can't try this from IBOConsole I'm not sure if the rewrite is
correct.
Is there anything obvious wrong with what I am doing?
frode