Subject | Re: [firebird-support] Preformance without 'Temporary Tables' |
---|---|
Author | Arno Brinkman |
Post date | 2004-01-09T13:22:14Z |
Hi,
And in fact don't you want to do this then instead of running 6 queries :
UPDATE
ACTIONS U
SET
U.SERVED = U.SERVED /
(SELECT Count(*) FROM ACTIONS A WHERE A.TICKET_REF = U.TICKET_REF)
?
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81
> UPDATE ACTIONS UCould you show us your PLAN please.
> SET U.SERVED = U.SERVED / 7
> WHERE U.TICKET_REF IN
> ( SELECT A.TICKET_REF FROM ACTIONS A
> GROUP BY A.TICKET_REF
> HAVING COUNT(A.TICKET_REF) = 7 )
>
> Is simple enough, hopefully you can see where I am going ( I
> want to run it for 6 down to 2 as well ;) ), and I'm not too
> concerned about the time it takes - except after 3 hours it
> had not finished!
And in fact don't you want to do this then instead of running 6 queries :
UPDATE
ACTIONS U
SET
U.SERVED = U.SERVED /
(SELECT Count(*) FROM ACTIONS A WHERE A.TICKET_REF = U.TICKET_REF)
?
Regards,
Arno Brinkman
ABVisie
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Firebird links :
http://www.firebirdsql.com
http://www.firebirdsql.info
http://www.fingerbird.de/
http://www.comunidade-firebird.org/
Nederlandse firebird nieuwsgroep :
news://80.126.130.81